0
votes

I have 2 combo boxes and on selecting value from 1st combobox it should get added to the second combobox. For this ,I get the instance of model of combo box 1 and set the selected value in the model instance. Then I do a combobox2.getStore() and to this store, I do a store.add(model). The issue Is the value gets added to the store of combobox 2(checked this in firebug),but not reflected when I click on combobox2 to check if the value is added.Tried to use bindStore(store),but did not work. Any help is highly appreciated.Thanks...

1
share some of your code so we can try and spot where it's failing - martskins

1 Answers

0
votes

Instead of adding a record to the current store, try and set a new store to the combobox and then use the combo's store's loadData method, like this:

combo.store.loadData(newStore.getRange(), false);

That should work

Here are the links to what you should know about the methods used in this solution..

http://docs.sencha.com/extjs/4.2.2/#!/api/Ext.data.Store-method-getRange

http://docs.sencha.com/extjs/4.2.2/#!/api/Ext.data.Store-method-loadData

It's pretty easy to understand what's going on once you read those.