Check documentation for the latest version of dhtmlxSuite loadJSONObject DHTMLX Docs

loadJSONObject

loads dhtmlxTree from a JSON object

void loadJSONObject(object jsonObject,function afterCall,string type);

Deprecated

Use parse method

myTree.parse(jsonObject,"json");
jsonObjectobjecta json object
afterCallfunctionfunction which will be called after data loading
typestringtype of data, optional, xml by default

Example

var myTree = new dhtmlXTreeObject('treeboxbox_tree', '100%', '100%', 0); 
myTree.setSkin('dhx_skyblue');
myTree.setImagePath("../../codebase/imgs/csh_bluebooks/");
myTree.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.");
    }
);

Change log

deprecated since version 4.4

Back to top