public JsonResult SearchGridDataRequested() { // Get both the grid Model and the data Model // The data model in our case is an autogenerated linq2sql database based on Northwind. var gridModel = new RentrakJqGridModel(); IEnumerable<SingleMktGridReport> singleMktGridReports; singleMktGridReports = singleMktGridReportService.GetSingleMktGridReports("753", "9959", "01/01/2015", "09/30/2015", "379"); // customize the default Orders grid model with our custom settings SetUpGrid(gridModel.RentrakGrid); // return the result of the DataBind method, passing the datasource as a parameter // jqGrid for ASP.NET MVC automatically takes care of paging, sorting, filtering/searching, etc return gridModel.RentrakGrid.DataBind(singleMktGridReports); }
public ActionResult JQGrid() { // Get the model (setup) of the grid defined in the /Models folder. var gridModel = new RentrakJqGridModel(); var ordersGrid = gridModel.RentrakGrid; // customize the default Orders grid model with custom settings // NOTE: you need to call this method in the action that fetches the data as well, // so that the models match SetUpGrid(ordersGrid); // Pass the custmomized grid model to the View return View(gridModel); }