PDA

View Full Version : One Store, Many Comboboxes



strickjb
13 Jan 2012, 11:53 AM
How can I reuse a Store for multiple Comboboxes but filter the Store data for each Combobox.

For example, if I have a store that contains cars w/ different colors and they are all in the same 'Cars' store. Then I have two comboboxes, one that displays all red cars and one that displays all blue cars but they both point to the same store.

store.filter('color', 'red') would work great if I were using a 1 store to 1 combobox solution. But here it would affect the other combobox. Is there a way I can leave the filtering up to the combobox?

Thanks in advance!

Romick
13 Jan 2012, 12:10 PM
I think you should create three stores. Load only one on onLoad populate two others. And everyone store can be filtered.
Or onother option is when you do filter on one store copy rezults to another store with needed rezults.