这是我的商店。

var studentStore = new Ext.data.SimpleStore ({
    fields :['value','name'],
    data :studentArray
})


这是我的ext js组合框。

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
});


我尝试添加侦听器,doQuery和方法覆盖。但是这些都不起作用。

最佳答案

只需将此配置添加到组合框即可。

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;
    }
}

关于javascript - Ext Js 2.1 Combobox Anymatch过滤器不起作用,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/26777749/

10-11 13:20
查看更多