View Full Version : TreePanel with multiple TreeStores

28 Aug 2009, 10:00 AM
Hi all,

In my application I have several classes that extend TreeStore<ModelData> for different parts of my UI. I am now building a reporting section in my application and would like to display these different tree stores at the same time for filtering the reports.

I'm wondering if there is a way to build a TreePanel that is rendered using multiple TreeStore objects, with each TreeStore represented by a root node in the TreePanel?


31 Aug 2009, 12:28 AM
i think you need to make a nee treestore for this tree and use this method to add each "sub"treestore to this new treestore

http://extjs.com/deploy/gxtdocs/com/extjs/gxt/ui/client/store/TreeStore.html#add(M,%20java.util.List,%20boolean) (http://extjs.com/deploy/gxtdocs/com/extjs/gxt/ui/client/store/TreeStore.html#add%28M,%20java.util.List,%20boolean%29)

public void add(M (http://extjs.com/forum/../deploy/gxtdocs/com/extjs/gxt/ui/client/store/TreeStore.html) parent,
java.util.List<M (http://extjs.com/forum/../deploy/gxtdocs/com/extjs/gxt/ui/client/store/TreeStore.html)> children,
boolean addChildren) Adds the models to the given parent and fires the Add event.
Parameters:parent - the parentchildren - the childrenaddChildren - true to recursively add all children