开发者

Dynamically hiding controls in an ExtJS Fieldset

开发者 https://www.devze.com 2023-02-23 06:53 出处:网络
Is there any event to hide some controls in fieldset based on checkbox check/uncheck events thanks in advance

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 开发者_StackOverflow(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();
          }
        },


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


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


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


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()

0

精彩评论

暂无评论...
验证码 换一张
取 消