setting cell attributes for json-loaded grids

I am porting a grid to JSON that was previously loaded via XML like the following



the problem is the image="" cell attribute. I realize that I cannot directly do it this way, so I’m sending the image filename back as a userdata attribute, and then trying to set the cell attribute in JS directly via:


function loadingEnd() {

for (var i=0; i<mygrid.getRowsNum(); i++) {

id = mygrid.getRowId(i);

image = mygrid.getUserData(id, “image”);

if (image != null) {

cell = mygrid.cellById(id, 0);

cell.setAttribute(“image”, image);




I added some debug statements and the cell’s “image” attribute is being properly set (according the getAttribute), but I am not seeing the behavior I want (the row has child rows and I want a folder icon to appear instead of the leaf icon). Everything else is working properly (I see the +/- box and the child rows display when the folder is expanded). I just need the icon to be correct.

Do I need to refresh the cell/grid somehow for the changes to take effect? Or is what I’m trying to do not possible?

Actually you can set attributes into the JSON format:



“A Time to Kill”,
“John Grisham”,

Please check the attachment

data.json (929 Bytes)