ExtJs:在前台判断Combobox的store 是否为空

来源:互联网 发布:网络视听通则 编辑:程序博客网 时间:2024/05/19 17:22

Combobox三角下拉箭头的监听为 'focus' ,在点击下拉箭头时判断是否为空

  1. 先加载store

    store.load();
  2. 将Combobox的加载模式设置为本地加载

    combobox = new Ext.form.ComboBox({store : store,mode : "local",//本地加载    }
  3. 监听focusgetCount()函数获取判断store是否为空

        listeners : {    "focus" : function(){        if(store.getCount == 0) alert("Combobox值为空");        }    }
0 0
原创粉丝点击