Reputation: 1593
This is my store.
var studentStore = new Ext.data.SimpleStore ({
fields :['value','name'],
data :studentArray
})
This is my ext js combobox.
ddlStudentCombo = new Ext.form.ComboBox({
id:'ddlDocCat',
emptyText:'Type..',
hideTrigger:true,
width:140,
store: studentStore,
applyTo:'ddlStudent',
displayField :'name',
forceSelection:true,
selectOnFocus: true,
listWidth:320,
mode: 'local',
listClass: 'x-combo-list-small',
typeAhead:true
});
I tried adding listeners, doQuery ,method overriding. But these are not working.
Upvotes: 1
Views: 621
Reputation: 1593
Just add this config to combobox.
enableKeyEvents: true,
listeners: {
'beforequery': function(queryEvent) {
this.store.filter('name', this.getRawValue(), true, false);
queryEvent.combo.onLoad();
// prevent doQuery from firing and clearing out my filter.
return false;
}
}
Upvotes: 1
Reputation: 113
I think you should set autoLoad : true for the store.
var studentStore = new Ext.data.SimpleStore ({
fields :['value','name'],
data :studentArray,
autoLoad : true
})
Upvotes: 0