解决下拉树消失的问题

/*重写ComboBox中onViewClick方法,解决弹出的选择框中点击任何部分,包括选中节点、点击空白处以及点击展开下级节点,弹出框都会自动关闭问题*/
Ext.override(Ext.form.ComboBox, { 
       onViewClick : function(doFocus) { 
         var index = this.view.getSelectedIndexes()[0], s = this.store, r = s.getAt(index); 
         if (r) { 
          this.onSelect(r, index); 
         } else if (s.getCount() === 0) { 
           this.collapse(); 
         } 
         if (doFocus !== false) { 
           this.el.focus(); 
         } 
       } 
     });

你可能感兴趣的:(ExtJs)