hello - i downloaded the dhtmlxGrid Standard and am trying to load json into the gird but am not having much luck.
i modeled what the json will look like when it comes from the source:
var bookData = [
{
“bookData”:
[
{“bookId”:“1”,“bookTitle”:“A Time to Kill”,“Author”:“John Grisham”,“Price”:“100”},
{“bookId”:“2”,“bookTitle”:“Blood and Smoke”,“Author”:“Stephen King”,“Price”:“200”},
{“bookId”:“3”,“bookTitle”:“The Rainmaker”,“Author”:“John Grisham”,“Price”:“300”},
{“bookId”:“4”,“bookTitle”:“The Rainmaker”,“Author”:“John Grisham”,“Price”:“300”},
{“bookId”:“5”,“bookTitle”:“The Rainmaker”,“Author”:“John Grisham”,“Price”:“300”},
{“bookId”:“6”,“bookTitle”:“The Rainmaker”,“Author”:“John Grisham”,“Price”:“300”},
{“bookId”:“7”,“bookTitle”:“The Rainmaker”,“Author”:“John Grisham”,“Price”:“300”},
{“bookId”:“8”,“bookTitle”:“The Rainmaker”,“Author”:“John Grisham”,“Price”:“300”},
{“bookId”:“9”,“bookTitle”:“The Rainmaker”,“Author”:“John Grisham”,“Price”:“300”},
{“bookId”:“10”,“bookTitle”:“The Rainmaker”,“Author”:“John Grisham”,“Price”:“300”},
]
}
];
mygrid = new dhtmlXGridObject(‘gridbox’);
mygrid.setImagePath(“…/codebase/imgs/”);
mygrid.setHeader(“Book title,Author,Price”);
mygrid.setInitWidths(“200,150,100”);
mygrid.setColAlign(“left,left,left”);
mygrid.setColTypes(“ro,ro,ro”);
mygrid.setColSorting(“str,str,int”);
mygrid.enableSmartRendering(true);
mygrid.init();
mygrid.enableAutoWidth(true);
mygrid.enableAutoHeight(true);
mygrid.enableLightMouseNavigation(true);
mygrid.attachFooter('Total sales,#cspan,${#stat_total}');
mygrid.enableAlterCss("even","uneven");
mygrid.setStyle("background-color:#2b634f;color:white; font-weight:bold;", "","color:red;", "");
data = bookData;
mygrid.parse(data,"json");
how do i get json into the grid?