View Full Version : Two Combo Boxes using one JsonStore

22 Nov 2010, 7:05 AM
Hi Forum,

I have a question regarding to the use of the JsonStore in conjunction with ComboBoxes. The fields in the second combo box should be dependent to the selection of the first combo box.

For example the first comboBox should display the names of the store and the second should display the urls of the selected name.

var store = new Ext.data.JsonStore({
url: 'foo.bar',
storeId: 'myStore',
// reader configs
root: 'data',
fields: ['name', 'url', 'url2']
});How can I do that? I know that it should be placed into the select event of the first combo box ...

22 Nov 2010, 8:23 AM
Define another (empty) store for the second combobox and load it with data in the select event of the first combobox (using loadData).