How to create JSON object format to render tree

hi

I have sucessfully render JSON object but facing the issue while rendering the tree.

  1. how to create JSON array structure to render tree.
  2. I need tree structure up to trre level.

thanks
dilip

Hi,

here is the example of tree json:

var treeData = {id:0,item:[
	{id:1,text:"item 1"},
	{id:2, text:"item 2",item:[
		{id:"21", text:"child 2_1"}
        ]},
	{id:3,text:"item 3"}
]}
tree.loadJSONObject(treeData);

Alexandra 's example is not running!

have error!
“Uncaught SyntaxError: Unexpected token ILLEGAL”

Locally the same works correctly. Make sure that dhtmlxtree_json.js is attached.

dhtmlx.com/docs/products/dht … _json.html