DHTMLX Docs & Samples Explorer

### Autoloading from XML

Advanced processing of XML allows this JavaScript tree menu to handle large amount of data. Dynamical items loading from XML stream enables you to create DHTML trees with unlimited number of nodes. You can load data asynchronously in dhtmlxTree as-needed (using AJAX) that increases overall performance of the tree. It means that the script specified in setXMLAutoLoading() method will be called when you click the tree to expand any of the parent nodes (which child nodes were not loaded). The script will get the id of the node to open, and return the XML with description of the child items.

Source

    <link rel="STYLESHEET" type="text/css" href="../../codebase/dhtmlxtree.css">
    <script  src="../../codebase/dhtmlxcommon.js"></script>
    <script  src="../../codebase/dhtmlxtree.js"></script>

    <div id="treeboxbox_tree" style="width:250px; height:218px;background-color:#f5f5f5;border :1px solid Silver;; overflow:auto;"></div>
    <br>

    <script>tree = new dhtmlXTreeObject("treeboxbox_tree", "100%", "100%", 0);
    tree.setSkin('dhx_skyblue');
    tree.setImagePath("../../codebase/imgs/csh_bluebooks/");
    tree.setXMLAutoLoading("php/xml.php");
    tree.loadXML("php/xml.php?id=0");</script>