Default Icon Tree

Hi,

I’m searching a way to decrease JSON data structure of my tree. All items have the same icon, even if it’s a parent open or closed.

Here is my structure:

{id:"0",item:[
	{id:"1",text:"obj1",im0:"../../bmp/223.png",im1:"../../bmp/223.png",im2:"../../bmp/223.png"},
	{id:"2",text:"obj2",im0:"../../bmp/223.png",im1:"../../bmp/223.png",im2:"../../bmp/223.png"}
]}

Is it possible de give a default icon for all my items ? which permit to remove im0,im1,im2 :

{id:"0",item:[
	{id:"1",text:"obj1"},
	{id:"2",text:"obj2"}
]}

Thanks

Hi
There is a special method for this: setStdImages:

tree = new dhtmlXTreeObject("treeboxbox_tree2", "100%", "100%", 0); tree.setSkin('dhx_skyblue'); tree.setImagePath("../dhtmlxTree_prof/codebase/imgs/csh_bluebooks/"); tree.setIconPath("../../bmp/"); tree.setStdImages("223.png","223.png","223.png"); tree.setDataMode("json"); tree.loadJSONObject({ id:'0', item:[ {id: 'node1', text: 'node1', item:[ {id: 'node11', text: 'node11'}, {id: 'node12', text: 'node12'} ]} ]});

Thanks,
It’s exactly what I need.

You are welcome!