Extjs TreePanel : Loading different nodes per level

466 Views Asked by At

I have a tree panel I want to basically use for a CMS which is used to manage music events

the structure I want is:

root
-- event 1
---- settings
---- details
---- instances
---- etc etc
-- event 2
---- settings
---- details
---- instances
---- etc etc
-- event 3
---- settings
---- details
---- instances
---- etc etc

The events are loaded dynamically using a REST service - the next level of nodes (settings, details, instances etc) are standard across all events. I have the 1st level loading - the event names - the problem I am having now is knowing how to append the standard nodes to each of the event nodes?

Obviously clicking on the leaf nodes loads a form or whatever into the main panel.

Anyone got any clues?

1

There are 1 best solutions below

0
On

If you are not loading the entire tree when the tree store loads, then your event nodes need to be collapsed (i.e. expanded:false ). When you expand a node the treestore will automatically send an ajax request with a node property using the id of the node (i.e. node:"event id" ). So you would just need to build your proxy URL to retrieve the standard node info for the node id.