Hi,
does anyone knows how to load standard/native json data into a grid, i cannot find any complete example, any insight will be great help. For example Ext Js does such data mappings out of the box.
here is the sample json data copied from the dhtmlx documentation website there was comma missing, i added it,
{“total_count”:3, “pos”:0, “data”:[
{ “col1”: “A Time to Kill”,
“col2”: “John Grisham”,
“col3”: “100”
},
{ “col1”: “Blood and Smoke”,
“col2”: “Stephen King”,
“col3”: “1000”
},
{ “col1”: “The Rainmaker”,
“col2”: “John Grisham”,
“col3”: “-200”
}
]}
i thought i will share this bad documentation that costed me more than half a day (trying to learn dhtmlx) seems like nice product but poor documentation.
what i found was that the example given in the documenation say use column ids like
BADDDDDDDDDDDDDDDDDDDDDDDDDDDD
mygrid = new dhtmlXGridObject(‘gridbox’);
mygrid.setColumnIds(“col1”, “col2”, “col3”);
CORRECTTTTTTTTTTTTTTTTTTTTTTTTTT (AT least it worked for me)
mygrid = new dhtmlXGridObject(‘gridbox’);
mygrid.setColumnIds(“col1,col2,col3”);
it does not like double quotes after every column and does not even like a space after comman.
hope this saves some one else many hours.
I apologize. You’re right.
There’s a typo in the documentation. It will be corrected in the near future.
The correct format you can find in the api: docs.dhtmlx.com/api__dhtmlxgrid_ … mnids.html