json object icon

Hi!!

How do I specify another icon then leaf.gif?

{ rows:[ { id:'1001', data:[ {"value":"row A","image":"folder.gif"}, "A Time to Kill", "John Grisham", "12.99", "1", "05/01/1998"], rows:[ { id:'sub_1001', data:[ "subrowA", "Blood and Smoke", "Stephen King", "0", "1", "01/01/2000" ] }, { id:'sub_1002', data:[ "subrowB", "Blood and Smoke", "Stephen King", "0", "1", "01/01/2000"] } ] }, { id:'1002', xmlkids:'1', data:[ "row B", "The Green Mile", "Stephen King", "11.10", "1", "01/01/1992"] } ]

thank you

and is it possible to load the image from a remote url?

Be sure that dhtmlxgrid_json.js is included on the page.

You can replace simple text value, such as

 "subrowA",

with json object

{"value":"subrowA","image":"some.gif"},

which allows you to define a custom image for any row in the treegrid.
It can be a remote url

{"value":"subrowA","image":"http://some.com/some.gif"},

Thanks!

It works, but, when I assign an external link it created the html like this:

<img src="imgs/icons_greenfolders/http://www.website.com/icon.gif" align="absmiddle" title="Maison communale">

and if I remove the line

mygrid.imgURL = "imgs/icons_greenfolders/";

I dont know where to set the “+” and “-” icons…

anyone please?

You may try to use the following workaround:

mygrid.imgURL = “imgs/icons_greenfolders/”;
mygrid.setIconPath(“http://”);

{“value”:“subrowA”,“image”:“www.website.com/icon.gif”}, // remove “http://” from the url here