View Full Version : One Store acting as Multiple

5 Mar 2014, 2:50 AM
I have a large json data file from which many different combo box needs to be made.
Now i have stored this json in store (Big Store).

1) Now, should i use this Big Store and change reader of store dynamically and use data to fill in combo box ?
(I don't know whether changing reader is possible or not)

2) Or can i copy data from big store to different stores (on condition basis like reader) ?
if yes, then how ?

3) Last is the way i was trying to avoid, Making multiple stores and readers, calling data many times and filling combo box. :|

Please guide me on the correct and best approach.

5 Mar 2014, 3:38 AM
I dont know if (1) is possible. you can use (2). you can load all data in one request and then go through it and use your criteria to differentiate the data to find out which data goes in which store. you can create an array of data for each store and use store.loadData(dataArray); to load the data into the array. you WILL need a separate store for each combobox in this case but you will only be loading data once in your main store. you should also set the combo's queryMode to 'local'.

10 Mar 2014, 9:10 PM
Thanks.. i am trying this only.. it seems to work till now, will again pop up new question if faced will any issue.

Thanks again :)