dhtmlx tree does not create tree when root node id is not 0

This is response from server to create tree:

var data = {
    "id" : "3232",
    "item" : [{
            "id" : "2169",
            "userdata" : [],
            "text" : "root",
            "item" : [{
                    "id" : "2170",
                    "text" : "child",
                    "item" : null,
                    "child" : 0,
                    "userdata" : [{
                            "name" : "data-title",
                            "content" : "childTitle"
                        }, {
                            "name" : "data-code",
                            "content" : "child-2170"
                        }
                    ]
                }
            ],
            "child" : 0
        }   
    ]
}

tree.loadJSONObject(data);

but dhtmlx tree does not create tree with this data. but when i change root node id to 0, it’s create tree successfully!

is there a way to solve this problem?

Hello,

You should pass a correct root id in dhtmlXTreeObject (4th parameter):

var tree = new dhtmlXTreeObject(htmlObject, width, height, “3232”);

If you are using attachTree to initialize tree object, you should also pass “3232”:

var tree = cell.attachTree(“3232”)