1
Vote

Documentation Incomplete

description

The methods returning JSON in the documentation are incomplete. How to correctly construct the JSON is not included. It would be nice to have a full example instead of parts of one :)

comments

psavva wrote Dec 26, 2014 at 4:58 PM

This is how I do it.
 [HttpGet]
public ActionResult GridPaging(int? page)
        {
            var data = getData.ToList().AsQueryable();
            var grid = new AjaxGrid<DataModel>(data, page.HasValue ? page.Value : 1, page.HasValue, 10);
            return Json(new { Html = grid.ToJson("_GridPartialView", this), grid.HasItems }, JsonRequestBehavior.AllowGet);
        }
where:
getData is a an array of Data.
_GridPartialView is a partial view which contains only the grid