Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change Ext js store data dynamically

I have a combobox which looks like below

{
  xtype:'combo',
  fieldLabel:'Test',
  store:['a','b']
}

Without creating Ext store object I am assigning the array to store and it is displaying the values fine.

At some action i want to update the store with ['d','e']

I have tried by assigning the new values to store like below

comboObje.store=['d','e'];

but it is not updating the values.

how to replace the orginal values with new values in the store.

like image 885
Surya Prakash Tumma Avatar asked Sep 03 '15 16:09

Surya Prakash Tumma


1 Answers

You can create a new store using bindStore or just load new data to the existing store using loadData:

combo.store.loadData(['d', 'e'].map(function(item){ return [item]; }));

Working example: https://fiddle.sencha.com/#fiddle/tb1

like image 61
CD.. Avatar answered Sep 19 '22 11:09

CD..