Schedule With very bad performance

1) I'm worked on the schedule control  and it takes a lot of time when loading more than 60 appointment  and if clicked on a day to get all details in "month View"  with more than 30 appointment  , it takes a lots of time then crash .
2) I'm tried to improved this delay by put an event on the date change and reload data according to that date and I need to set DataSource without  destroy the schedule object  just add the new data 

5 Replies

NR Nevitha Ravi Syncfusion Team March 23, 2018 08:37 AM UTC

Hi Weam, 

Thank you for contacting Syncfusion Support. 

We were unable to reproduce the reported problem “Schedule takes lot of time and then crash” at our end and for the same we have prepared a sample for your reference which can be viewed from the below link. 

We can use Load  on demand concept in order to filter only current view appointments by enabling enableLoadOnDemand property to avoid delays in loading the appointments. We have prepared a sample with 75 appointments within a single month and more than 30 appointments within a day for your reference which can be downloaded from the below link. 

            $("#Schedule1").ejSchedule({ 
                width: "100%", 
                height: "525px", 
                currentDate: new Date(2015, 5, 15), 
                enableLoadOnDemand: true, 
                appointmentSettings: { 
                    dataSource: dataManager, 
                    id: "Id", 
                    subject: "Subject", 
                    startTime: "StartTime", 
                    endTime: "EndTime", 
                    startTimeZone: "StartTimeZone", 
                    endTimeZone: "EndTimeZone", 
                    allDay: "AllDay", 
                    recurrence: "Recurrence", 
                    recurrenceRule: "RecurrenceRule" 
                } 
            }); 
        }); 
Controller 
        public ActionResult GetData(string CurrentView, DateTime CurrentDate, string CurrentAction) 
        { 
            var data = AppointmentRepository.FilterAppointment(CurrentDate, CurrentAction, CurrentView); 
            BatchDataResult result = new BatchDataResult(); 
            result.result = data; 
            result.count = db.MultipleResources.ToList().Count > 0 ? db.MultipleResources.ToList().Max(p => p.Id) : 1; 
            return Json(result, JsonRequestBehavior.AllowGet); 
        } 



Please check the above sample, if the issue persist still try to reproduce the issue in the above sample and revert back to us. Also, it would be helpful for us to investigate further on this, if you could share the details on any other specific Schedule features that you use in your application. 

Regards, 
Nevitha. 



WG weam ghalab March 25, 2018 11:25 AM UTC

thank you for the respond
- My data is more than 75 Appointments per day (ignoring time) are last to  more than 2 year so. it take so much time to load  about 1 min 



NR Nevitha Ravi Syncfusion Team March 27, 2018 04:32 PM UTC

Hi Weam, 

Thanks for your update. 

Before proceeding further on this, we would like to know whether you have used load on demand concept at your end. When we use LOD concept that filters the current view appointments and bind only those specific appointment count alone to the Schedule initially, it will reduce the loading time even if we have bulk number of appointments at database. So please try our shared sample and also revert us the details which view you are loading initially and the number of appointments getting loaded in the current view (either all were normal or recurring events). 

In the above sample, we have rendered nearly 1000 appointments in a month and more than 50 appointments per day and it takes 10 seconds to load month view and 2 seconds to other views. 


Regards, 
Nevitha 
 



WG weam ghalab March 29, 2018 04:09 PM UTC

I used the property of load on demand but the search feature didn't work due to the result of (ScheduleObj.searchAppointments(searchString, "Subject", "contains", false))   return (ej.Query()) instead of  list of data 


VD Vinitha Devi Murugan Syncfusion Team March 30, 2018 07:01 AM UTC

Hi Weam, 
  
Thanks for your update. 
  
While using LOD concept, we filter and bind the appointments for currently viewable dates in the Schedule from server-side and it is not necessary to use the client-side searchAppointments public method. Kindly include the below code in your controller page code block and check our previously shared sample. 
  
        public ActionResult GetData(string CurrentView, DateTime CurrentDate, stringCurrentAction) 
        { 
            var data = AppointmentRepository.FilterAppointment(CurrentDate, CurrentAction, CurrentView); 
            BatchDataResult result = new BatchDataResult(); 
            result.result = data; 
            result.count = db.MultipleResources.ToList().Count > 0 ? db.MultipleResources.ToList().Max(p => p.Id) : 1; 
            return Json(result, JsonRequestBehavior.AllowGet); 
        } 
AppointmentRepository.cs 
  
        public static List<MultipleResource> FilterAppointment(DateTime CurrentDate,String CurrentAction, String CurrentView) 
        { 
            ScheduleDataDataContext db = new ScheduleDataDataContext(); 
            DateTime CurrDate = Convert.ToDateTime(CurrentDate); 
            DateTime StartDate = FirstWeekDate(CurrDate.Date); 
            DateTime EndDate = FirstWeekDate(CurrDate.Date); 
            List<MultipleResource> DefaultScheduleList = db.MultipleResources.ToList(); 
            switch (CurrentView) 
            { 
                case "day": 
                    StartDate = CurrentDate; 
                    EndDate = CurrentDate.AddHours(24); 
                    break; 
                case "week": 
                    EndDate = EndDate.AddDays(7); 
                    break; 
                case "workweek": 
                    EndDate = EndDate.AddDays(5); 
                    break; 
                case "month": 
                    StartDate = CurrDate.Date.AddDays(-CurrDate.Day + 1); 
                    EndDate = StartDate.AddMonths(1); 
                    break; 
            } 
            DefaultScheduleList = db.MultipleResources.ToList().Where(app => app.StartTime >= StartDate && app.StartTime <= EndDate || app.Recurrence == 1).ToList();// here appointments for particular date range is filtered from database 
            return DefaultScheduleList; 
        } 
  
        internal static DateTime FirstWeekDate(DateTime CurrentDate) 
        { 
            try 
            { 
                DateTime FirstDayOfWeek = CurrentDate; 
                DayOfWeek WeekDay = FirstDayOfWeek.DayOfWeek; 
                switch (WeekDay) 
                { 
                    case DayOfWeek.Sunday: 
                        break; 
                    case DayOfWeek.Monday: 
                        FirstDayOfWeek = FirstDayOfWeek.AddDays(-1); 
                        break; 
                    case DayOfWeek.Tuesday: 
                        FirstDayOfWeek = FirstDayOfWeek.AddDays(-2); 
                        break; 
                    case DayOfWeek.Wednesday: 
                        FirstDayOfWeek = FirstDayOfWeek.AddDays(-3); 
                        break; 
                    case DayOfWeek.Thursday: 
                        FirstDayOfWeek = FirstDayOfWeek.AddDays(-4); 
                        break; 
                    case DayOfWeek.Friday: 
                        FirstDayOfWeek = FirstDayOfWeek.AddDays(-5); 
                        break; 
                    case DayOfWeek.Saturday: 
                        FirstDayOfWeek = FirstDayOfWeek.AddDays(-6); 
                        break; 
                } 
                return (FirstDayOfWeek); 
            } 
            catch 
            { 
                return DateTime.Now; 
            } 
        } 
  
Kindly try out the above code snippet in your sample and let us know if you need any further assistance on this. 
  
Regards, 
M.Vinitha Devi. 


Loader.
Up arrow icon