1

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.

Veer
  • 1,575
  • 3
  • 16
  • 40

2 Answers2

1

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; 
    }
}
Veer
  • 1,575
  • 3
  • 16
  • 40
0

I think you should set autoLoad : true for the store.
var studentStore = new Ext.data.SimpleStore ({ fields :['value','name'], data :studentArray, autoLoad : true })

sumanth
  • 113
  • 1
  • 13