Skip to content Skip to sidebar Skip to footer

Fullcalendar: How To Recreate/reinitialize Fullcalendar Or Batch Add Multiple Events

I am trying to batch add new events to the calendar but failed to find a convenient method to use. So I then decided to just reinitialize the view with new events array. So I tried

Solution 1:

Just found a walkaround.. You could do

$('#calendar').fullCalendar({
    events: events
});
$('#calendar').fullCalendar('destroy');
$('#calendar').fullCalendar();

to destroy it and then recreate.

But still, I do not know how to batch-add events.

Solution 2:

You can use addEventSource() like so:

.fullCalendar( 'addEventSource', events )

Source may be an Array/URL/Function just as in the events option. Events will be immediately fetched from this source and placed on the calendar

Post a Comment for "Fullcalendar: How To Recreate/reinitialize Fullcalendar Or Batch Add Multiple Events"