Load grid from json

Hi,
I’m trying to load data into a grid using this json:

{rows:[{id:0, data:[“Apr 14”,“1100”]}]}

This is how I initialize the grid:

gridChartStats = cellStatsGrid.attachGrid(); gridChartStats.setImagePath('dhtmlx/imgs/'); gridChartStats.attachHeader("#rspan,#rspan"); gridChartStats.setHeader(["Mese/Anno", "Fatturato"]); gridChartStats.setColSorting("str,str"); gridChartStats.setColTypes("ro,ro"); gridChartStats.init(); gridChartStats.parse(jsonabove,"json");

but I get this error:

typeError: a.rows is undefined
…cess_js_row,_locator:this._get_js_data});this.rowsAr[e]=a[c]}}else for(c=0;c<a.r…
dhtmlx.js (riga 842)

I’m using library 3.6.

Thanks in advance,
Samuel

Unfortunately the issue cannot be reproduced locally.
Your code works well for me.
If issue still occurs, please, provide with a complete demo, where the problem can be reconstructed.

I try the “standard” version of the json:

var jsonForGrid = {“total_count”:5, “pos”:0, “data”:[{“col1”:“Humef”,“col2”:“1100”}]}

adding/changing those few lines of the grif:

gridChartStats.setColumnIds(“col1”, “col2”);
gridChartStats.parse(jsonForGrid,“js”);

No errors this time, but the grid show empty rows…

I’m back to json version and I found the glitch.
The json was returned as a string from a function and I messed to call

	jsonForGrid = eval('(' + jsonForGrid + ')');

to create the json object.

Regards,
Samuel