...
return Json(true);
@(Html.EJ().Grid<object>("Grid") .Datasource(ds => ds.URL("/Home/DataSource").Adaptor("UrlAdaptor").UpdateURL("/Home/Update").InsertURL("/Home/Insert").RemoveURL("/Home/Delete")) .Query("new ej.Query().addParams('data', new Date())") .EditSettings(edit => { edit.AllowEditing().AllowAdding().AllowDeleting(); }) public ActionResult DataSource(DataManager dm, DateTime data) { var DataSource = OrderRepository.GetAllRecords(); DataResult result = new DataResult(); result.result = DataSource.Skip(dm.Skip).Take(dm.Take).ToList(); result.count = DataSource.Count(); return Json(result, JsonRequestBehavior.AllowGet); |
Hi Omar,
Thanks for contacting Syncfusion support.
To get the custom data in all calls, we suggest you to use the query API. We can also pass the parameter in addParams property using query API.
Please find the code example and sample:
@(Html.EJ().Grid<object>("Grid")
.Datasource(ds => ds.URL("/Home/DataSource").Adaptor("UrlAdaptor").UpdateURL("/Home/Update").InsertURL("/Home/Insert").RemoveURL("/Home/Delete"))
.Query("new ej.Query().addParams('data', new Date())")
.EditSettings(edit => { edit.AllowEditing().AllowAdding().AllowDeleting(); })
--------------------------------------------
public ActionResult DataSource(DataManager dm, DateTime data)
{
var DataSource = OrderRepository.GetAllRecords();
DataResult result = new DataResult();
result.result = DataSource.Skip(dm.Skip).Take(dm.Take).ToList();
result.count = DataSource.Count();
return Json(result, JsonRequestBehavior.AllowGet);
}
Sample: http://www.syncfusion.com/downloads/support/forum/123532/ze/EJGrid-1184275223
Refer to the Help document for query API,
http://help.syncfusion.com/js/api/ejgrid#members:query
Regards,
Prasanna Kumar N.S.V