Hi, I’m novice in DHTMLX
I have a my action:
public JsonResult Data() { var groups = groupService.BuscaTodos(); return Json(new { rows = groups }, JsonRequestBehavior.AllowGet); }
Return this json:
{“rows”:[{“Name”:“name test”,“Description”:“description Test”,“Id”:110,“Date”:null}]}
and my view:
but , return error:
Uncaught TypeError: Cannot read property ‘length’ of undefined
Any?
In my jsonresult
I’m use
public JsonResult Data() { var groups = groupService.BuscaTodos(); return Json(new { rows = groups.Select(x => new { x.Id, data = new object[] { x.Id, x.Name.ToString(), x.Description.ToString() } }) }, JsonRequestBehavior.AllowGet);
}
=)
Please, refer to the grid basic json format: docs.dhtmlx.com/grid__data_forma … jsonformat
In your case you are closer to the “Native JSON format”. The tutorial about the loading you can find by the same link.