Scheduler getevents doesnot return any data

Hi Team,

I have implemented Scheduler in Javascript. I have a few questions related to recursive event details retrieving.

  1. I am trying to get recursive events using scheduler.getEvents( ev.startdate, ev.enddate) in the Event “onEventAdded” . I suppose Scheduler should have been loaded by the time it hits onEventAdded event. By right it should return all-recursive events. But the array resulted in ZERO neither the recursive events nor the normal events have come up. Not sure what went wrong. In which events can we call getEvents method?

  2. I tried this even scheduler.attachEvent(“onXLE”, function(){ alert("Number of Events : " + scheduler.getEvents().length); }); but resulted in ZERO. do we need to attach this event after any particular event ?

  3. Could you share some knowledge on options like “After 1 occurrences”
    in the recursive events. how actually they work with all the scenarios like weekly, Monthly , yearly .and when we need to go for this option.

Thanks,
Gayatri

Hi @gayatri.akki

Seems you mean Recurring Events.

onEventAdded API event fires when the user adds a new event to the scheduler, you can see it in this snippet.

onXLE was deprecated, please use onLoadEnd event instead.

When you use scheduler.getEvent() method and recurring events are enabled, the ‘from’-‘to’ arguments are required. Otherwise it is impossible to return all instances of the series with no end dates, that may exist in the calendar and method will return an empty array.

Please see how the method works with onDataRender handler in the snippet. I use this handler because the data is rendered there.

Detailed info specified here in the docs, point 3: https://prnt.sc/sbaw3n
I.e. instead of specifying the end_date, you can set the number of occurrences in the series of the recurring event.