MNR
MNR

Reputation: 275

Dynamically hiding controls in an ExtJS Fieldset

Is there any event to hide some controls in fieldset based on checkbox check/uncheck events

thanks in advance


sample code for (Listner of Fieldset )

listeners: {
          collapse: function () {
            //debugger;
            if (Ext.getDom('chkWarrantyCover').checked == false) {
              Ext.getCmp("WarrantyFieldset").expand();
              Ext.getDom('chkWarrantyCover').checked = false
              Ext.getDom('btnComEdit').style.visibility = "hidden";
              Ext.getDom('btnEditPerson').style.visibility = "hidden";
            }
            else
              Ext.getCmp("WarrantyFieldset").expand();
          }
        },

Upvotes: 0

Views: 4250

Answers (4)

MNR
MNR

Reputation: 275

I'm using "onCheckClick" event for fieldset:

Code:onCheckClick: function () {
    if (Ext.getDom('chkWarrantyCover').checked == true) {
        Ext.getDom('btnComEdit').style.visibility = "visible";
        Ext.getDom('btnEditPerson').style.visibility = "visible";
        Ext.getDom('btnEditNotify').style.visibility = "visible";
}
 else {
} 

Regards

Upvotes: 1

amackay11
amackay11

Reputation: 729

In Extjs 4.0 there does not seem to be collapse/expand/onCheckClick events. Not sure how this would be possible in 4.0.

Upvotes: 1

Truesky
Truesky

Reputation: 221

can you provide some sample codoe of what you are attempting to do? If not the listener is the most obvious answer. I would say do it on a select event and check for that on the checkbox id. Usually you can get the state with Ext.getCmp()

Upvotes: 0

Evan Trimboli
Evan Trimboli

Reputation: 30092

Listen to the collapse/expand events on the fieldset, they will fire when the checkbox state changes.

Upvotes: 0

Related Questions