public ActionResult GridData() { JqGridData<Log> gridData = GetGridData(); var filter = new JqGridFilter<Log>(Request, gridData); var jqGridJsonResult = new JqGridJsonResult<Log>(gridData, filter); IEnumerable<Log> logs = GetMockLogs(); if (filter.OrderByFunc != null) { logs = filter.Ascending ? logs.OrderBy(filter.OrderByFunc) : logs.OrderByDescending(filter.OrderByFunc); } return jqGridJsonResult.Result(logs .Skip((filter.Page - 1)*filter.Rows) .Take(filter.Rows) , logs.Count()); }
public ActionResult GridData() { JqGridData <Log> gridData = GetGridData(); var filter = new JqGridFilter <Log>(Request, gridData); var jqGridJsonResult = new JqGridJsonResult <Log>(gridData, filter); IEnumerable <Log> logs = GetMockLogs(); if (filter.OrderByFunc != null) { logs = filter.Ascending ? logs.OrderBy(filter.OrderByFunc) : logs.OrderByDescending(filter.OrderByFunc); } return(jqGridJsonResult.Result(logs .Skip((filter.Page - 1) * filter.Rows) .Take(filter.Rows) , logs.Count())); }