Issue 2497: Add hook to get ALL eventSources
Status:  Duplicate
Merged:  issue 2168
Owner: ----
Closed:  May 2015
Reported by Adrien.b...@gmail.com, May 1, 2015
Hi all,

Heads up: please see the SO question that triggered this feature request http://stackoverflow.com/questions/29987278/fullcalendarjs-method-fullcalendarclientevents-returns-duplicate-events/

In some cases, one must reinitialize the calendar & redisplay the events that were last present in the calendar: but not via adding each single event, but rather via adding the eventSources.

I would expect a method such as: .fullCalendar('allEventSources')

This would enforce consistency with using the following methods:
 .fullCalendar( 'addEventSource', source )
.fullCalendar( 'removeEventSource', source )

I could then simply do something such as:
// 1. Back up my event sources
// 2. Destroy my calendar
// 3. Create & initialize new calendar (& do all sort of fancy stuff initialization if needed)
// 4. Add the backed up event sources (see step 1) to the new calendar

var allEventSources = $('.my-calendar').fullCalendar('allEventSources'); /* [1] */
$('.my-calendar').fullCalendar('destroy'); /* [2] */
$('.my-calendar').fullCalendar(calendarOptions); /* [3] */
var arrayLength = allEventSources.length;
for (var i = 0; i < arrayLength; i++) {
    $('.my-calendar').fullCalendar( 'addEventSource', allEventSources[i]);  /* [4] */
}
May 26, 2015
Project Member #1 adamrs...@gmail.com
(No comment was entered for this change.)
Status: Duplicate
Mergedinto: 2168