读书人

ExtJs combobox模模糊糊匹配

发布时间: 2012-06-29 15:48:47 作者: rapoo

ExtJs combobox模糊匹配

{xtype : 'combobox',fieldLabel : '选择银行',name : 'bankDTO.id',allowBlank : false,queryMode : 'remote',displayField : 'name',valueField : 'id',store : Ext.create('Ext.data.Store', {fields: ['id', 'name'],proxy : {type : 'ajax',url : getRequestPath('bank_listBank.action'),reader : {type : 'json',root : 'bankList'}},autoLoad : true}),listeners : {beforequery : function(e) {var combo = e.combo;   if(!e.forceAll){   var value = e.query;   combo.store.filterBy(function(record,id){   var text = record.get(combo.displayField);   return (text.indexOf(value)!=-1);   });combo.expand();   return false;   }}}}

读书人网 >JavaScript

热点推荐