How do you fetch recurring appointments being displayed from schedule instance?

I need to find both regular and recurring appointments currently being shown in my schedule.
But I can't find where the schedule instance holds the calculated appointments (the ones being drawn in the schedule).
I can only find the regular appointments AND the master appointment for a recurring series (before recurring instances are calculated).

Clearly the appointments in the schedule are already calculated based on the recurrence rule, but how do I fetch those?

Also, getAppointments() never holds any data, I have to use _currentAppointmentData to get appointments.
I have the following output when dataBound is completed:
  • 1 regular appointment
  • 1 recurring appointment



function OnActionComplete(args) {

        if (args.requestType == 'dataBound') {

            var schObj = $("#Schedule1").data("ejSchedule");

            var appointments = schObj.getAppointments();
            console.debug('schObj.getAppointments() length: ' + appointments.length);

            appointments = schObj._currentAppointmentData;
            console.debug('schObj._currentAppointmentData length: ' + appointments.length);

            for (var i = 0; i < appointments.length; i++) {
                var app = appointments[i];
                console.debug('' + app.Subject + ' - ' + app.StartTime);
            }
        }
    }


What I would like is a list of all the appointments displayed in the schedule. Is this information stored in the schedule object?
Sample project attached.

Attachment: Sample_908e0237.zip

3 Replies

VD Vinitha Devi Murugan Syncfusion Team December 3, 2019 10:47 AM UTC

Hi Toke, 
 
Syncfusion Greetings. 
 
We have prepared the sample to show the list of appointments collection in console and same can be available in below link. 

 
actionComplete: function (e) { 
        var schObj = $("#Schedule1").data("ejSchedule"); 
        // To get all master appointments rendered in Schedule 
        console.log("Master appointments rendered in Schedule"); 
        console.log(schObj.getAppointments()); 
        // To get all processed appointments including occurrences of recurrence appointment 
        console.log("All processed appointments in Schedule"); 
        console.log(schObj._processed); 
        // To get current view appointments  
        console.log("Current view appointments") 
        console.log(schObj._renderedApp); 
        // To get current view occurrences 
        console.log("Current view occurrences"); 
        var x = schObj._renderedApp.filter(x => x.RecurrenceRule); 
        console.log(x); 
        // To get All occurrences 
        console.log("All occurrences"); 
        var y = schObj._processed.filter(x => x.RecurrenceRule); 
        console.log(y); 
        } 
 
Kindly try with the above sample and let us know, if you need any further assistance on this. 
 
Regards, 
M.Vinitha devi 



TW Toke Wivelsted December 3, 2019 11:59 AM UTC

Thank you, this is what I needed.


VD Vinitha Devi Murugan Syncfusion Team December 4, 2019 06:04 AM UTC

Hi Toke, 
 
Thanks for your update. 
 
We are happy to hear that our solution has fulfilled your requirement.  
 
Regards, 
M.Vinitha devi 


Loader.
Up arrow icon