DHTMLX Docs & Samples Explorer

loadJSONObject(json,afterCall)

Required library edition: This method works with any edition of DHTMLX library
Required library file: dhtmlxtree_json.js

loads dhtmlxTree from a JSON object

  • json - a json object
  • afterCall - function which will be called after xml loading
var tree = new dhtmlXTreeObject('treeboxbox_tree', '100%', '100%', 0); 
tree.setSkin('dhx_skyblue');
tree.setImagePath("../../codebase/imgs/csh_bluebooks/");
tree.loadJSONObject(
             {id:0, item:[
                 {id:1,text:"1111"},
                 {id:2, text:"222222", item:[
                     {id:"21", text:"child"}
                 ]},
                 {id:3,text:"3333"}]
             }, function(){alert("Your data has been loaded.");}
)