| Issue 889: | refetchevents does not work for events as an array | |
| 3 people starred this issue and may be notified of changes. | Back to list |
Say I call the calendar and point the events to an empty array.
$('#calendar').fullCalendar({
events:someEmptyArray;
};)
After the calendar has been intiated, I do something to populate that array. Then say I create a button that calls the refetchevents method.
This does not update the calendar with the newly updated array.
However, this works for other sources such as a JSON. Am I misunderstanding something?
May 3, 2011
#1
oszkar.n...@gmail.com
May 3, 2011
I found a better work around to this than recreating the calendar is to use removeEvents and then addEventSource
$('#calendar').fullCalendar('removeEvents');
$('#calendar').fullCalendar('addEventSource', eventsArray );
May 3, 2011
Ah, great - thanks for sharing!
May 8, 2011
glad you came up with a solution. this is a tricky issue because as soon as you reassign your someEmptyArray variable, fullcalendar has no way of knowing what the new reference is. this is more a javascript limitation than anything else. oszkar, wraping the array in a data-source object is a smart thing to do, but it'd only work if you assigned it back to the `events property before rerendering. at least i think that's what was going on.
Status:
Done
|
|
| ► Sign in to add a comment |