i got this method
The Goal is:
Everytime i change the second combo, it generate the third combo, with its own valueField and displayField.
Combobox RawValue Blank After Dynamic BindStore
Code:
privGenerateComboLain: function(chart, cmbAsal) {
var windowModal = chart.up('window');
var toolbarNya = windowModal.down('toolbar');
var comboLain = toolbarNya.down('combobox:nth-child(3)');
var keyNya = cmbAsal.getValue();
Ext.define('comboLainModel', {
extend: 'Ext.data.Model',
fields: [{
name: keyNya
}]
});
comboLainStore = Ext.create('Ext.data.Store', {
model: 'comboLainModel',
proxy: {
type: 'ajax',
url: '/service/get/data/tna/2',
reader: {
type: 'json',
root: 'records'
}
},
autoLoad: false
});
comboLainStore.load({
params: { 'selectOnly': keyNya },
callback: function() {
comboLain.displayField = keyNya;
comboLain.valueField = keyNya;
comboLain.bindStore(comboLainStore);
}
});
},
The Goal is:
Everytime i change the second combo, it generate the third combo, with its own valueField and displayField.
The problem is :
First time change event in second combo work as expected, and time after that (when comboLainStore (store in third combo) loaded), the rawValue (of third combo) is always empty (but the displayField and valueField is there). The redbox combobox is ComboLain (third combo), where the previous combobox, had an event to call privGenerateComboLain method.
Is it legal to change the displayField and the valueField on the fly before/after load the related store? How to display records in the third combo?
Please make my day....
Combobox RawValue Blank After Dynamic BindStore
Aucun commentaire:
Enregistrer un commentaire