问题
Value in combo box doesn't filter and value "null" still show.
This code SkpdCombo.js and I didn't find what error. So please help me what's mistake and what should I do with this code?
Ext.define('App.view.skpd.SkpdCombo', {
extend: 'App.view.CommonCombo',
alias: 'widget.SkpdCombo',
fieldLabel: 'Skpd',
displayField:'_combo_',
valueField: 'skpd_id',
queryMode: 'remote',
initComponent: function() {
if (!this.store){
this.store = new App.store.SkpdStore();
this.store.load();
}
this.callParent();
this.store.on('load', function(store, records, successful, operation, eOpts){
var value_no = this.getValue();
if (store.find('skpd_no', value_no) != null){
this.setValue(value_no);
}else{
this.store.clearFilter(true);
}
}, this);
}
});
Ok I'll wait for your answer guys. Thanks.
回答1:
this.store.load();
is called before the store onLoad
event is defined.
Also
this.callParent();
I think must be the first call in the constructor.
来源:https://stackoverflow.com/questions/44558923/how-to-filter-combo-extjs-when-there-is-empty-value