ext js checkbox 触发选择事件 的方法

来源:互联网 发布:安卓系统怎么关闭网络 编辑:程序博客网 时间:2024/05/22 18:13

如下是formpanel中的checkbox:

{xtype:"checkbox",id:"fruit_lib_sel",name:"fruit_lib_sel",inputValue:0,boxLabel:"全选",checked:false},


下面是onReady中的代码,其中fruit_lib_sel为id:

    Ext.EventManager.on('fruit_lib_sel','click',handleClick);
    fruit_lib_sel.on("click",handleClick);



或者是在配置项handler里面配置js函数,如下:

  function selSomeClick(){
        for (var i = 0; i < myCheckboxGroup.items.length; i++)    
        {    
            var chkName = myCheckboxGroup.items.itemAt(i).name;  
            var flag = f.getForm().findField(chkName).getValue();
        }
    }


{xtype:"checkbox",name:"fruit_lib2",inputValue:2,boxLabel:"万方(期刊文章、会议论文、学位论文)",checked:false,handler:selSomeClick},