public JsonResult AjaxHistoryPaged(int?page) { var vm = GetHistory(); var grid = new AjaxGridFactory().CreateAjaxGrid(vm, page ?? 1, page.HasValue); return(Json(new { Html = grid.ToJson("Partial/History", this), grid.HasItems }, JsonRequestBehavior.AllowGet)); }
public ActionResult Grid2(int?page) { var cars = PartitionedData(); var grid = new AjaxGridFactory().CreateAjaxGrid(cars, page.HasValue ? page.Value : 1, page.HasValue); return(Json(new { Html = grid.ToJson("_Grid2", this), grid.HasItems }, JsonRequestBehavior.AllowGet)); }
public ActionResult FilterGrid(GridFilter gridFilter, int?page) { if (ModelState.IsValid) { var cars = PartitionedData().Where(x => (x.CarMake == gridFilter.CarMake || gridFilter.CarMake == null) && x.Year == gridFilter.Year); var grid = new AjaxGridFactory().CreateAjaxGrid(cars, page.HasValue ? page.Value : 1, page.HasValue, 5); return(Json(new { Html = grid.ToJson("_FilteredGrid", this), grid.HasItems }, JsonRequestBehavior.AllowGet)); } Response.StatusCode = (int)HttpStatusCode.BadRequest; return(Json(ModelState.Errors(), JsonRequestBehavior.AllowGet)); }
public JsonResult AjaxHistoryPaged(int? page) { var vm = GetHistory(); var grid = new AjaxGridFactory().CreateAjaxGrid(vm, page ?? 1, page.HasValue); return Json(new { Html = grid.ToJson("Partial/History", this), grid.HasItems }, JsonRequestBehavior.AllowGet); }