I have an application that works with three kinds of objects (Foo, Bar and Baz). The user can create and manage lists of these objects. The lists can furthermore be grouped, thus creating a tree-like structure.
I want to use one TreeStore for each kind of lists (`store.FooLists`, etc.) for adding, changing and deleting the lists. This is easy enough.
I also want to have a sidebar with a unified tree panel. It goes like this:
So, I need another TreeStore for this sidebar. But I want the "List X" items to be loaded from the respective TreeStores (`FooLists`, `BarLists`, `BazLists`).
| +-- All Foos
| +-- List 1
| +-- List 2
| +-- List Group 1
| +- List 3
| +-- All Bars
| +-- ...
+-- All Baz's
What is the cleanest way to embed one TreeStore inside another, so that changes in the embedded store propagate up and cause a refresh of the sidebar view?