Ext ComboBox 能够根据输入的record的指定字段过滤列表
combo默认能够根据输入的内容过滤的列表内容,不过这个过滤只是根据displayField来的。如果要能够同时根据自己制定的字段过滤就需要如下修改:
在combo的源码的doQuery方法中
if(forceAll === true || (q.length >= this.minChars)){ if(this.lastQuery !== q){ this.lastQuery = q; if(this.mode == 'local'){ this.selectedIndex = -1; if(forceAll){ this.store.clearFilter(); }else{ this.store.filter(this.displayField, q); //hack if(this.otherFilterField){ this.setValue(this.getRawValue()); if(this.store.data.length==0) this.store.filter( this.otherFilterField, q); } } this.onLoad();