Hi
I have two combo boxes combo and Combo2 and three stores Store1, MyStore1, MyStore2. In first combo box, they are two values in drop-down list Fruits and Vegetables getting from Store1. If I select Fruits in first combo-box, then its showing Mango and Orange in drop-down list of second combo-box(Combo2) getting from MyStore1( COL2 as a field in Store and getting it as valuefield and displayField). However, if I select Vegetables in first combo-box, then its not showing Okra and Cauliflower in drop-down list of second combo-box(Combo2) getting from MyStore2( COL3 as a field in Store and getting it as valuefield and displayField).
My scenario is as shown below written in select event of first combo box.
Please help me in this.
if(combo.getValue() == 'Fruits')
{
var combobox = Ext.getCmp('Combo2');
var fieldValue1, displayField1;
var vegstore = Ext.getStore('MyStore1');
combobox.bindStore(vegstore);
valueField = 'COL2';
displayField = 'COL2';
combobox.valueField = valueField;
combobox.displayField = displayField;
}
else if (combo.getValue() == 'Vegetables')
{
var combobox = Ext.getCmp('Combo2');
var fieldValue,displayField;
var vegstore = Ext.getStore('MyStore2');
combobox.bindStore(vegstore);
valueField = 'COL3';
displayField = 'COL3';
combobox.valueField = valueField;
combobox.displayField = displayField;
}