hi guys sorry for creating this duplicate thread but solution presented in previous thread was not working ..
I am using extjs 3.4.0 I have a json store as follows
Code:
var cat2Store = new Ext.data.JsonStore({
fields: ['cid','id', 'value'],
root: 'cat2',
url: 'json/combo2.json'
});
it reads the following json file
Code:
{
cat2:[
{
cid:'1',
id:'1',
value : 'A1'
},{
cid:'1',
id:'2',
value : 'A2'
},{
cid:'2',
id:'3',
value : 'B1'
},{
cid:'2',
id:'4',
value : 'B2'
}
]
,
cat3:[
{
cid:'1',
id:'1',
value : 'C1'
},{
cid:'1',
id:'2',
value : 'C2'
},{
cid:'2',
id:'3',
value : 'D1'
},{
cid:'2',
id:'4',
value : 'D2'
}
]
}
the store is read by a combobox as shown below
Code:
{
xtype: 'combo',
id : 'combo1',
hiddenName: 'genre',
fieldLabel: 'Cat2',
mode: 'local',
store: cat2Store,
displayField:'value',
valueField:'id',
triggerAction: 'all',
listeners:
{
select :
function(e)
{
//Help needed here
}
}
}
my question is how do i change the root of my store from cat2 to cat3 on the select event of the combobox