change week event

Hi
We have to extract the appointment data when we change the week. We need to reload the page with the new data. How can I plug in a code when I change the week?

1 Reply

NR Nevitha Ravi Syncfusion Team December 7, 2020 05:41 AM UTC

Hi Gilles, 

Greetings from Syncfusion Support. 

We suspect that your requirement is to load the current view appointments alone on the scheduler, so we suggest you to use datamanager for performing CRUD actions which will have start and end date of current view based on which you can filter the appointments and load to the scheduler. Please refer to the following sample. 


Controller page in service sample: 
    public JsonResult LoadData(Params param)  // Here we get the Start and End Date and based on that can filter the data and return to Scheduler 
        { 
            var data = db.ScheduleEventDatas.Where(app => (app.StartTime >= param.StartDate && app.StartTime <= param.EndDate) || (app.RecurrenceRule != null && app.RecurrenceRule != "")).ToList();  // Here filtering the events based on the start and end date value. 
            return Json(data, JsonRequestBehavior.AllowGet); 
        } 

var dataManager = new ej.data.DataManager({ 
  url: "http://localhost:54738/Home/LoadData", // Here need to mention the remote data path 
  crudUrl: "http://localhost:54738/Home/UpdateData", 
  adaptor: new ej.data.UrlAdaptor(), 
  crossDomain: true 
}); 

Please run the service to load the appointments to the scheduler. The LoadData method will trigger on scheduler actions like date/view navigations.  

Kindly check the solution meets your requirement and get back to us if you need any further assistance. 

Regards, 
Nevitha 


Loader.
Up arrow icon