Loading node images based on type

I am attempting to implement behavior which will display a different icon for each of four different leaf node types. Since I am constructing the templated JSON in a seperate translator class, I attempted simply do perform the following:

{
“id”:14,
“text”:“CountrySize [greaterthan] 1000000”,
“open”:“1”,
“img0”:“testImg”,
“userdata”:[
{
“name”:“Msg”,
“content”:“test”
},
{
“name”:“Key”,
“content”:“CountrySize”
},
{
“name”:“Op”,
“content”:“greaterthan”
},
{
“name”:“Value”,
“content”:“1000000”
}
]
}

This JSON content is then rendered as a tree in my HTML/JS file by calling loadJSON() on it:

The tree is loading just fine, but the images for all the leaf nodes are the default white paper icon. Is there a better way to be setting the im0 for all nodes where userdata[Msg]==“test”??

thanks for your input!

You should use:

im0:“testImg.gif”,

Please check tutorial here dhtmlx.com/docs/products/doc … index.html