Combobox模糊匹配-过滤

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
triggerAction: 'all',
enableKeyEvents : true,
mode: 'local',
forceSelection: true,
selectOnFocus: true,
lastQuery: '',
listeners : {
beforequery: function(e){
var combo = e.combo;
if(!e.forceAll){
var value = e.query;
combo.getStore().filterBy(function(record,id){
var text = record.get(combo.displayField);
return (text.indexOf(value)!=-1);
});
combo.expand();
return false;
}
}
}

这些插入到combobox代码块中
参考:
http://pingfan.iteye.com/blog/514163
http://blog.csdn.net/sjyingwei/article/details/8444382