fraxzi Posted June 28, 2021 Share Posted June 28, 2021 Hi, I have a Boolean field and I wish to assign a value from fieldset when click/unclick the CheckboxToggle. There's no "OnExpand" or "OnCollapse" event.. How to do it? Thanks, Frances Quote Link to comment Share on other sites More sharing options...
Sherzod Posted June 28, 2021 Share Posted June 28, 2021 Hello, Sorry, can you please explain in more detail? Quote Link to comment Share on other sites More sharing options...
fraxzi Posted June 28, 2021 Author Share Posted June 28, 2021 Hi @Sherzod, This FieldSet has CheckboxToggle = true, when uncheck/check at runtime, i'd like to capture when it expand/collapse. like: if fieldset expanded, Variable = true else Variable = false Thanks, Quote Link to comment Share on other sites More sharing options...
Sherzod Posted June 28, 2021 Share Posted June 28, 2021 Hi, OK. I'll check. Quote Link to comment Share on other sites More sharing options...
fraxzi Posted July 5, 2021 Author Share Posted July 5, 2021 Hi @Sherzod Any news? Thanks, Frances Quote Link to comment Share on other sites More sharing options...
Sherzod Posted July 5, 2021 Share Posted July 5, 2021 On 6/28/2021 at 10:45 AM, fraxzi said: This FieldSet has CheckboxToggle = true, when uncheck/check at runtime, i'd like to capture when it expand/collapse. Hello, Sorry for the late response. You can use ClientEvents. UniFieldSet1 -> ClientEvents -> ExtEvents -> function collapse(fieldset, eOpts) { ajaxRequest(this, '_collapse', ['collapsed='+true]); } function expand(fieldset, eOpts) { ajaxRequest(this, '_collapse', ['collapsed='+false]); } procedure TMainForm.UniFieldSet1AjaxEvent(Sender: TComponent; EventName: string; Params: TUniStrings); begin if EventName = '_collapse' then if Params.Values['collapsed'].ToBoolean then ShowMessage('collapsed') else ShowMessage('expanded') end; Quote Link to comment Share on other sites More sharing options...
fraxzi Posted July 5, 2021 Author Share Posted July 5, 2021 8 hours ago, Sherzod said: Hello, Sorry for the late response. You can use ClientEvents. UniFieldSet1 -> ClientEvents -> ExtEvents -> function collapse(fieldset, eOpts) { ajaxRequest(this, '_collapse', ['collapsed='+true]); } function expand(fieldset, eOpts) { ajaxRequest(this, '_collapse', ['collapsed='+false]); } procedure TMainForm.UniFieldSet1AjaxEvent(Sender: TComponent; EventName: string; Params: TUniStrings); begin if EventName = '_collapse' then if Params.Values['collapsed'].ToBoolean then ShowMessage('collapsed') else ShowMessage('expanded') end; Hi @Sherzod, Works great! Then can I expand the fieldset if I have a field with true value? Thanks, Frances Quote Link to comment Share on other sites More sharing options...
Sherzod Posted July 5, 2021 Share Posted July 5, 2021 7 minutes ago, fraxzi said: Then can I expand the fieldset if I have a field with true value? Hello, Do you mean programmatically? Quote Link to comment Share on other sites More sharing options...
fraxzi Posted July 5, 2021 Author Share Posted July 5, 2021 Just now, Sherzod said: Hello, Do you mean programmatically? Yes Sir. Just now, Sherzod said: Hello, Do you mean programmatically? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted July 5, 2021 Share Posted July 5, 2021 procedure TMainForm.UniButton1Click(Sender: TObject); begin UniFieldSet1.JSInterface.JSCall('expand', []); //UniFieldSet1.JSInterface.JSCall('collapse', []); end; Quote Link to comment Share on other sites More sharing options...
fraxzi Posted July 6, 2021 Author Share Posted July 6, 2021 13 hours ago, Sherzod said: procedure TMainForm.UniButton1Click(Sender: TObject); begin UniFieldSet1.JSInterface.JSCall('expand', []); //UniFieldSet1.JSInterface.JSCall('collapse', []); end; Hi @Sherzod, Works like magic! Thanks much for the great support. now I can reduce the screen clutter for cleaner look. Regards, Frances 1 Quote Link to comment Share on other sites More sharing options...
fraxzi Posted March 21, 2023 Author Share Posted March 21, 2023 Hi @Sherzod, How Can I set UniFieldSet1.CheckboxToggle programmatically? Thanks in advance. Frances Quote Link to comment Share on other sites More sharing options...
Sherzod Posted March 21, 2023 Share Posted March 21, 2023 23 minutes ago, fraxzi said: How Can I set UniFieldSet1.CheckboxToggle programmatically? Hello, Can you please explain in more detail? Quote Link to comment Share on other sites More sharing options...
fraxzi Posted March 22, 2023 Author Share Posted March 22, 2023 Hi @Sherzod I'd like to change from this: (Collapsible, CheckboxToggle) To this: (no more CheckboxToggle) -> programmatically like if I chick a button. I tried fieldset.checkboxtoggle := false or with fieldset.collapsible := false, but not success. I hope you can suggest how to do it. Thanks, Frances Quote Link to comment Share on other sites More sharing options...
Sherzod Posted March 23, 2023 Share Posted March 23, 2023 Hello @fraxzi It seems that there is no such possibility in ExtJS itself. I do not know yet. We can try to find a workaround. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted March 23, 2023 Share Posted March 23, 2023 On 3/22/2023 at 5:20 AM, fraxzi said: I tried fieldset.checkboxtoggle := false or with fieldset.collapsible := false, but not success. Maybe you will try this solution? procedure TMainForm.UniButton1Click(Sender: TObject); begin UniFieldSet1.Collapsible := not UniFieldSet1.Collapsible; with UniFieldSet1 do if CheckboxToggle then if Collapsible then begin JSInterface.JSCall('checkboxCmp.show', []); JSInterface.JSCall('getEl().down(".x-fieldset-header-text").resumeEvent', ['click']); end else begin JSInterface.JSCall('checkboxCmp.hide', []); JSInterface.JSCall('getEl().down(".x-fieldset-header-text").suspendEvent', ['click']); end; end; 1 Quote Link to comment Share on other sites More sharing options...
fraxzi Posted March 24, 2023 Author Share Posted March 24, 2023 17 hours ago, Sherzod said: Maybe you will try this solution? procedure TMainForm.UniButton1Click(Sender: TObject); begin UniFieldSet1.Collapsible := not UniFieldSet1.Collapsible; with UniFieldSet1 do if CheckboxToggle then if Collapsible then begin JSInterface.JSCall('checkboxCmp.show', []); JSInterface.JSCall('getEl().down(".x-fieldset-header-text").resumeEvent', ['click']); end else begin JSInterface.JSCall('checkboxCmp.hide', []); JSInterface.JSCall('getEl().down(".x-fieldset-header-text").suspendEvent', ['click']); end; end; Hi @Sherzod, The Guro strikes again! ... you always amaze me (us). works perfectly. Thanks, Frances 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.