[zTree] Ztree Binding

[zTree] Ztree Binding

  
Forge Component
(12)
Published on 2017-02-13 by Eduardo Luís
12 votes
Published on 2017-02-13 by Eduardo Luís

Hi,

Is it possible to bind ztree child nodes based on Parent node. My requirement is to bind the first set of Parent nodes in preparation and when user clicks on the Parent node, a service call will return the child nodes for that parent. If I took both Parent and child nodes in preparation, it will take more time to load data since my procedure is dealing with large amount of data. So I thought of splitting up into 2 steps, first will load all the Parents and click on a Parent load its child nodes. 

Can someone point me to any instructions on how to implement this?

Thanks,

Anjitha Mohan


Hi Anjitha , 

that's exacly what I've done. Preparation only loads "parents". Then when click on a parent, call a server action to reload the list with the full data (parents and childs). If you have a huge amount of data, best approach would be to lazy load the ztree widget on the screen and maybe add cache to the SQL Query that feeds that list.

In the ztree example espace you have all the demos about calling server actions and what not from ztree.