Search code examples
extjscomboboxjsonstore

using extjs jsonstore subdata in an combo field


following extjs3 problem: i have an json store:

dbStore = new Ext.data.JsonStore({
    url: '/?[action]=getFormData',
    storeId: 'formdata',
    fields: [{'database':['name', 'id'], 'parameter':['name','id']}],
    autoLoad: true
});

and i create an formpanel with following combo field:

{
xtype: 'combo',
name: 'database',
id: 'database',
store: ???,
fieldLabel: '',
valueField: 'id',
displayField: 'name',
emptyText: 'Select'
}

i want that combo field to use the 'database' fields 'name' and 'id', how to do that??


Solution

  • Try adding root:'database' to your store.