我想知道如何在extjs组合框中我可以搜索一个值。如果我输入'a'那么必须显示以a开头的项目列表,并且项目选择器应该选择它是否与'匹配'一个'我已经尝试了很多,但没有任何相关的是我的代码:
var account_details_store = new Ext.data.Store({
id:'acs_store',
reader: new Ext.data.JsonReader({
totalProperty: 'count',
fields: [{
name: 'accountid',
mapping: 'accountid'
},
{
name: 'accountname',
mapping:'accountname'
},
{
name: 'address',
mapping:'address'
},
{
name: 'city',
mapping: 'city'
},
{
name: 'contactnum',
mapping: 'contactnum'
}],
// fields: ['accountid','accountname','address','city','contactnum'],
root: 'rows'
}),
proxy: new Ext.data.HttpProxy({
url: 'accountdetailscombo.php'
}),
autoLoad:true
});
xtype: 'combo',
fieldLabel: 'Account details',
store:account_details_store,
valueField: 'accountid',
displayField:'accountname',
forceSelection:true,
typeAhead: false,
loadingText: 'Searching...',
emptyText: 'Type the first characters of the name',
minChars: 1,
anchor: '100%',
pageSize: 0,
hideTrigger:true,
editable: true,
triggerAction: 'all',
width: 280,
height:250,
tpl: tpl,
itemSelector: 'div.combo-result-item',
onSelect: function(record) {
this.setValue(record.data.accountname);
this.collapse();
// Ext.getCmp('acs_store')
}