I am having trouble retrieving events from the Scheduler. After reviewing their documentation, I learned that I need to implement SchedulerEventSupport in order to do so. Here is how I implemented it:
var agendaView = new Y.SchedulerAgendaView();
var dayView = new Y.SchedulerDayView();
var eventRecorder = new Y.SchedulerEventRecorder();
//global variable
eventSupport = new Y.SchedulerEventSupport();
var monthView = new Y.SchedulerMonthView();
var weekView = new Y.SchedulerWeekView();
schedule = new Y.Scheduler(
{
activeView: weekView,
boundingBox: '#myScheduler',
date: new Date(2013, 1, 4),
eventRecorder: eventRecorder,
items: events,
render: true,
eventSupport: eventSupport,
views: [dayView, weekView, monthView, agendaView]
}
);
function displayEvents(){
console.log(eventSupport.getEvents());
}
Every time I call displayEvents(), I encounter this error:
TypeError: Cannot read property 'sort' of undefined
.
Is there a way for me to successfully display the events stored in the scheduler?