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

              }
             }

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值