var dataManager = ej.DataManager({Any help will be greatly appreciated.
url: "/Reminders/Get?startDate=" + startDate + "&endDate=" + endDate,
adaptor: new ej.UrlAdaptor()
});
var notificationsDataManager = ej.DataManager({
url: "/Reminders/Notifications",
adaptor: new ej.UrlAdaptor()
});
$("#remindersGrid").ejGrid({
dataSource: dataManager,
columns: [
{ field: "Id", headerText: "Id", isPrimaryKey:true, visible:false},
......
],
allowPaging: true,
childGrid: {
dataSource: notificationsDataManager,
queryString: "Id",
columns: [
......
],
allowPaging: true
}
});
public ActionResult Get(DateTime? startDate, DateTime? endDate)
{
var reminders = _remindersProvider.GetReminders(DateTime.Now, DateTime.Now);
return Json(new { result = reminders, count = reminders.Count() }, JsonRequestBehavior.AllowGet);
}
public ActionResult Notifications(int id)
{
var notifications = _remindersProvider.GetReminderNotifications(id);
return Json(new { result = notifications, count = notifications.Count() }, JsonRequestBehavior.AllowGet);
}
<script type="text/javascript"> var dataManager = ej.DataManager({ url: "/Grid/DataSource", adaptor: new ej.UrlAdaptor() }); var notificationsDataManager = ej.DataManager({ url: "/Grid/DataSource2", adaptor: new ej.UrlAdaptor() }); $("#FlatGrid").ejGrid({ dataSource: dataManager, allowSorting: true, columns: [ --------------------------------------- ], childGrid: { dataSource: notificationsDataManager, queryString: "EmployeeID", allowPaging: true, columns: [ --------------------------------------- ], },
});
|