EXT JS 自定义模糊查询Combo

{
              store : familyTypeStore,
              xtype : 'combo',
              id : 'd30114',
              name : 'd30114',
              lastQuery : '',
              displayField : 'name',
              valueField : 'code',
              resizable : true,
              maxHeight:200,
              minHeight:200,
              typeAhead : true,
              fieldLabel : '户属性',
              mode : 'local',
              listClass:'x-combo-list' ,
              forceSelection : true,
              triggerAction : 'all',
              emptyText : '选择户属性',
              listeners : {
               beforequery : function(e) {
                var combo = e.combo;
                // alert(combo.list.)
                combo.collapse();
                if (!e.forceAll) {
                 var value = e.query;
                 if (value != null && value != '') {
                  combo.store.filterBy(function(record, id) {
                     var text = record.get('pcode');
                     // 用自己的过滤规则,如写正则式
                     return (text.indexOf(value) != -1);
                    });

                 } else {
                  combo.store.clearFilter();
                 }
                 combo.onLoad();//不加第一次会显示不出来  
                 combo.expand();
                 return false;
                }
               },
               change : onchangeValue

              }
             }

 

你可能感兴趣的:(EXT JS 自定义模糊查询Combo)