DHTMLX Docs & Samples Explorer

Autoloading from JSON

Advanced processing of JSON allows this JavaScript tree menu to handle large amount of data. Dynamical loading of items from JSON stream gives a possibility to create DHTML trees with unlimited number of nodes. dhtmlxTree has an ability to load data asynchronously as-needed (using AJAX) that increases overall performance of the tree.


Source
<link rel="STYLESHEET" type="text/css" href="../../codebase/dhtmlxtree.css">
<script  src="../../codebase/dhtmlxcommon.js"></script>
<script  src="../../codebase/dhtmlxtree.js"></script>
<script  src="../../codebase/ext/dhtmlxtree_json.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/json.php");
tree.setDataMode("json");
//load first level of tree;
tree.loadJSON("php/json.php?id=0");
</script>