Fetching child tree node names while clicking on a parent no


My tree(dhtmlxTree) need to have four layer of childs and the number of nodes in each layer is more than 50. I need to display the first layer while loading page and fetch child nodes of first layer while user clicks on any of the nodes in first layer and later layers.

Can any body suggest how to implement this with a sample.

Thanks and Regards,

Pravu Mishra.




you can use dynamic loading functionality. Please, see details in the article dhtmlx.com/docs/products/dhtmlxT … ading.html (dhtmlxTree/samples/loading_processing_data/tree_dyn_loading.html in the tree package)

Hi Alex,

found the following code for dinamic tree from the URLs provided by you.

           tree=new dhtmlXTreeObject(treeboxbox_tree,100%,100%,0);
//link tree to asp script
//load first level of tree

I used the following ways to get the value of id for the clicked node

1) var selectedId=dhxTree.getSelectedItemId();
2) var selectedText=dhxTree.getSelectedItemText();

But all did not help to get get the id value of the clicked node.

Could you please let me know how to get the value of the id for passing while using the loadXML method(the above bold string).

Thanks and Regards,

Pravu Mishra.




in case of dynamic loading the id of the loaded node is passed automatically. Please, see the article that was mentioned in the previous answer.

But getSelectedItemId() returns id correctly. When did you call this method ?