Unanswered: One instance of Model belong to multiple Stores
I need to share a model instance between two stores (a TreeStore and a Store).
A model instance can only have a reference to one store. I can listen the update event and propagate it to the other store but it need configuration, coding, ...
I search into the forum but I didn't find anything. In a old Ed Spencer post http://edspencer.net/2011/02/proxies-extjs-4.html. He said that I will be possible to do it in 4.0 (in february 2011). But I think that it's not yet available...
Anyone know if it's possible to share instance between multiple stores ?
I'm agree with you that, in some case, you didn't need to share instance. Filter is a good example.
But in some case, it's important (or easier) to share instance.
Example : a file browser. A tree to show the directory and a grid to show files and subfolders. If you change a subfolder name, it's nice if the node corresponding to this subfolders is automatically updated without listening store update event.
using the same store (instance) would be not easy to implement, since you have a treeStore for the tree and a plain store for the grid.
you can put all the data into the treeStore and fill the grid store on a node selection with the relevant subData. imho the easiest way to go. if the data is huge, i would only load the parent nodes for the tree and fetch the needed grid data via ajax on demand.