Hi Michael,
Thanks for contacting Syncfusion support.
Using dataManager with Schedule can be used to load data as well as perform CRUD operations on remote data binding. Initially, the data will be loaded through “url” path and then the CRUD operations on Schedule can be processed using “crudUrl” path. We have also prepared the simple CRUD sample which handles new appointment creation, editing existing appointments or deleting and also while dragging or resizing an appointment based on your requirement, which can be downloaded from the below location.
<code>
|
Client Side:
var dataManager = ej.DataManager({
url: "/Home/GetData", // used to load data initially
crudUrl: "/Home/Batch", // used to add / update / delete appointment
adaptor: new ej.UrlAdaptor()
});
$("#Schedule1").ejSchedule({
appointmentSettings: {
dataSource: dataManager
}
}); |
|
Server Side:
public JsonResult GetData() // initially this function returns appointments to load it in schedule
{
IEnumerable data = db.ScheduleDatas.Take(100);
return Json(data, JsonRequestBehavior.AllowGet);
}
public JsonResult Batch(EditParams param)
{
if (param.action == "insert" || (param.action == "batch" && param.added != null))
{
// this block of code will execute while inserting the appointments
}
if ((param.action == "remove") || (param.action == "batch" && param.deleted != null))
{
// this block of code will execute while removing the appointment
}
if (param.action == "update" || (param.action == "batch" && param.changed != null))
{
// this block of code will execute while updating the appointment
}
IEnumerable data = new DataClasses1DataContext().ScheduleDatas.Take(500);
return Json(data, JsonRequestBehavior.AllowGet);
} |
</code>
Kindly check the above sample and revert us with further details, if we have misunderstood your requirement or else if you need any further assistance on this.
Regards,
Sellakumar K