By using myStore.getAt(0).get('sg')
I am able to populate the data to 1st combo and same with 2nd combo myStore.getAt(0).get('aod')
.
To set the default values for each combo add
{
fieldLabel: 'Combo 1',
id: 'sg',
store: myStore.getAt(0).get('sg').data,
listeners: {
afterrender: function (combo) {
combo.setValue(myStore.getAt(0).get(combo.id).default);
}
}
}, {
fieldLabel: 'Combo 2e',
id: 'aod',
store: myStore.getAt(0).get('aod').data,
listeners: {
afterrender: function (combo) {
combo.setValue(myStore.getAt(0).get(combo.id).default);
}
}
}
and change the json as follows:
var myStore = Ext.create('Ext.data.Store', {
fields: [
{name: 'sg'},
{name: 'aod'}
],
data: [{
'sg': {
'default': 1,
'data': ['1', '2', '3', '4', '5']
}
}, {
'aod': {
'default': '15',
'data': ['15', '20']
}
}
]
});