Ext之Combox模糊查询配置
// The data store containing the list of states
var states = Ext.create('Ext.data.Store', {
fields: ['abbr', 'name'],
data : [
{"abbr":"AL", "name":"Alabama"},
{"abbr":"AK", "name":"Alaska"},
{"abbr":"AZ", "name":"Arizona"}
//...
]
});
// Create the combo box, attached to the states data store
Ext.create('Ext.form.ComboBox', {
fieldLabel: 'Choose State',
store: states,
queryMode: 'local',
displayField: 'name',
valueField: 'abbr',
renderTo: Ext.getBody()
});
上面是一个简单的下拉框,里面配置的queryMode:'local'意思是查询从本地取数,还有一个取值为remote,当在本地取数时键入查询关键字默认匹配首字符,也就是不能模糊查询,这时需要配置
enableRegEx:true才能实现。

浙公网安备 33010602011771号