BoldSignA modern eSignature application with affordable pricing. Sign up today for unlimited document usage!
$(function () { var dataManger = ej.DataManager({ url: "/Home/DataSource", adaptor: new ej.UrlAdaptor() }); $("#Grid").ejGrid({ dataSource: dataManger, allowPaging: true, columns: [ . . . ], }); });
[Controller] public ActionResult DataSource(DataManager dm) { var DataSource = new simpledbEntities2().Persons.ToList(); DataResult result = new DataResult(); DataOperations operation = new DataOperations(); result.result = DataSource; result.count = result.result.AsQueryable().Count(); if (dm.Skip > 0) result.result = operation.PerformSkip(result.result, dm.Skip);//To perform paging operation if (dm.Take > 0) result.result = operation.PerformTake(result.result, dm.Take);//To perform paging operation return Json(result, JsonRequestBehavior.AllowGet); |