As I was browsing through the dhtmlx documentation, I came across this particular method:
This method determines how the server-side URL is constructed when making dynamic loading calls:
<script>
tree.setXMLAutoLoadingBehaviour(mode);
</script>
There are different modes available for use:
The 'function' mode enables calling a user-defined handler specified as the first parameter of the setXMLAutoLoading() method.
While I grasp the concept that I need to create a function to add another layer of children to the selected node if it has children, I am struggling with figuring out the right parameters to accomplish this task.
I am currently loading a local JSON file using .loadJSON("data.json");
. To change this behavior to 'function' mode and call a function named loadBranch
that will load the children of the expanded node, I have included the following code snippet:
myTree.setXMLAutoLoadingBehaviour("function");
myTree.setXMLAutoLoading(function (id) { loadBranch(id)});
However, I am facing difficulty in writing a function that can specifically locate and add these children to my dhtmlx tree
. Any suggestions or code snippets on how to create such a function would be greatly appreciated!
Thank you in advance.
PS: My main objective is to develop a default dhtmlx tree that dynamically loads JSON data to compare its performance with other types of trees.