combo默认能够根据输入的内容过滤的列表内容,不过这个过滤只是根据displayField来的。如果要能够同时根据自己制定的字段过滤就需要如下修改:
在combo的源码的[color=red]doQuery方法中[/color]
然后需要构造这种combo的时候指定otherFilterField为record的其他字段就可以了
在combo的源码的[color=red]doQuery方法中[/color]
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();
然后需要构造这种combo的时候指定otherFilterField为record的其他字段就可以了