I want to load the grid by using json object.I used mygrid.parse(jsonobject,“json”) method.but the grid is not loaded with the data.
my view code is:
mygrid = new dhtmlXGridObject(‘gridbox’);
mygrid.setImagePath("…/…/dhtmlx/imgs/");
mygrid.setHeader(“ID,Name,Email,Salary,age,country,Married,Head,StartDate,WebsiteLink”);
mygrid.setInitWidths(“50,100,150,50,50,100,50,50,100,150”);
mygrid.setColAlign(“center,center,center,center,center,center,center,center,center,center”);
mygrid.setColTypes(“ed,ed,ed,price,ed,co,ch,ra,dhxCalendarA,link”);
mygrid.setColSorting(“int,str,str,dec,int,str,bit,bit,date,str”);
mygrid.init();
var url = ‘/Home/ToJSON’;
$.ajax({ type: “GET”,
url: url,
dataType: “json”,
error: function (xhr, status, error) {
alert(error);
},
success: function (json) {
mygrid.parse(json, “json”); -> not working
//alert(“Name:” + json.Name);
}
});
I checked whether the json data is coming or not by using alertbox.the data is displaying in the alert box.I am not sure how to pass the json object.
Any suggestions…