Adding, refreshing and removing a single appointment from schedule

Hello,
We have a schedule set up to refresh it's content with SignalR.
Currently we are using the RefreshAppointments() method to re-render all the appointments in the schedule, which can take a long time with 1000+ appointments distributed over 30+ resources.

Is it possible to change the schedule data for a single appointment and re-render that specific appointment alone?

For example if we get a SignalR update containing information about a new appointment, can we somehow add it to the schedule without having to redraw all appointments?

9 Replies 1 reply marked as answer

NR Nevitha Ravi Syncfusion Team October 27, 2020 02:46 PM UTC

Hi Toke, 

Greetings from Syncfusion Support. 

We have validated your scenario, you have selected EJ2 – Asp.NET MVC, but mentioned you have used the RefreshAppointments method which is in EJ1, can you please confirm your platform to proceed further on this? 

Regards, 
Nevitha 



TW Toke Wivelsted October 29, 2020 10:34 PM UTC

We are currently using EJ1, but is considering updating to EJ2 for performance reasons. Is either version capable of performing "single"-updates as described?

In our current implementation with EJ1 we have a huge bottleneck when RENDERING the content, and we've done some initial tests in EJ2 for comparison, which look promising. However, if we can have selective updates in the scheduler for EJ1 we will probably keep that implementation as it is heavily customized.


BS Balasubramanian Sattanathan Syncfusion Team October 30, 2020 01:32 PM UTC

Hi Toke, 

Thanks for your reply. 

We have analyzed your requirement with EJ1, by default the current view appointments will re-render when we perform CRUD actions. We have prepared a signalR sample for your reference which can be downloaded from the below link. 


Kindly let us know if you need further assistance 

Regards, 
Balasubramanian S 



TW Toke Wivelsted November 16, 2020 04:56 AM UTC

I cannot run he service sample as they are referencing some old outdated unobtainable version of Microsoft.NETCore.App

As far as I can tell, this sample still re-renders all appointments.
I looked through the code and I do not see the service - or schedule sample - updating a singular appointment in the schedule, can you please help me pinpoint it?



BS Balasubramanian Sattanathan Syncfusion Team November 17, 2020 12:20 PM UTC

Hi Toke, 

Thanks for the update. 

We have analyzed your reported scenario at our end and let you know that the scheduler will re-rendered when we add appointments dynamically. Since it is a default behavior of the Scheduler according to the architecture. 

Kindly let us know if you need further assistance.  

Regards, 
Balasubramanian S 



TW Toke Wivelsted November 18, 2020 06:26 AM UTC

I don't think you understand the problem.
The problem is that the scheduler will redraw every single appointment, not just the one that was changed.
This is very taxing when there are 1000+ appointments in the scheduler.

I am asking if the default behaviour of re-drawing all 1000+ appointments can be bypassed and only re-draw the one appointment that was changed.


BS Balasubramanian Sattanathan Syncfusion Team November 19, 2020 04:06 PM UTC

Hi Toke, 

Thanks for the update. 

We have validated your reported scenario at our end. We let you know that, at the time of initial rendering of events the Url will trigger for fetching the events from the DB. If we perform CRUD actions (like create/edit/delete events) the CrudUrl will trigger for create/update the data(i.e., events) in the table of the DB and then the Url will trigger for fetching the updated events from DB to the client end. So it will trigger for every single appointment. And using the below code snippet we can filter the current view data which will reduce the processing time when we using huge number of data. 

public JsonResult GetData() 
    // Here filtering the events based on the start and end date value. 
    IEnumerable data = new DataClasses1DataContext().Appointments.Where(app => (app.StartTime >= param.StartDate && app.StartTime <= param.EndDate) || (app.RecurrenceRule != null && app.RecurrenceRule != "")).ToList(); 
    return Json(data, JsonRequestBehavior.AllowGet); 
    return Json(data, JsonRequestBehavior.AllowGet); 


Kindly try the above solution and let us know if you need further assistance. 

Regards, 
Balasubramanian S 



TW Toke Wivelsted November 23, 2020 11:10 AM UTC

The back-end calculations are not the problem. I've changed your sample to generate 1000 random appointments and attached the HomeController.cs and Index.cshtml files to this reply. 

Generating the 1000 appointments takes 70ms, but rendering them in the schedule takes 15000ms. This means that every time we change a single task in the schedule, it has to spend 15 seconds re-rendering all the appointments - and while the rendering is under way the schedule is locked/frozen and can not be interacted with.


Attachment: 1000_appointments_51a6afcf.zip


BS Balasubramanian Sattanathan Syncfusion Team November 24, 2020 01:17 PM UTC

Hi Toke, 

Thanks for the update. 

We have analyzed your reported problem at our end and regret to let you know that the scheduler will get re-rendered when we do CRUD actions. And also we let you know that Syncfusion jQuery-based widgets are no longer in active development. In our EJ2 scheduler, it will not re-rendered for CRUD actions. So, we suggest you to switch to our pure JavaScript based next generation Essential JS 2 library for the better experience. Kindly refer to the below UG and online demo for more details about the EJ2 Scheduler and get back to us if you need any further assistance. 


Regards, 
Balasubramanian S 


Marked as answer
Loader.
Up arrow icon