| Issue 616: | addEventSource renders events twice | |
| 2 people starred this issue and may be notified of changes. | Back to list |
I've had a case, where I needed to add a googleCalender event source with addEventSource and at the same time refetch events from a json event source. Because addEventSource calls fetchEventSource, the events from the googleCalender where rendered twice.
I have added a second parameter to the function addEventSource which can be set to false to prevent it to call the fetchEventSource (see below).
Maybe you can include this in the next release as it might help in other cases...
addEventSource: function(source, update) {
if(update == null) update = true;
eventSources.push(source);
if(update) fetchEventSource(source, eventsChanged);
}
Further I had a case, where addEventSource had to be called twice for the same source (googleCalendar). This again rendered the events twice. I was able to fix this by adding an inArray test for eventSources:
addEventSource: function(source, update) {
if(update == null) update = true;
if($.inArray(source, eventSources) < 0) eventSources.push(source);
if(update) fetchEventSource(source, eventsChanged);
}
Aug 25, 2010
Project Member
#1
adamrs...@gmail.com
Aug 26, 2010
Adam I am sorry for not describing the error in more detail by giving you a demo. I have now created a test case in the attached zip file with the two cases: - gcal.html with fullcalendar.js which shows you the error - gcal-fixed.html with fullcalendar-fixed.js containing my fixes described in the previous comment. You can also check it online: http://www.lauper.cc/gcal/gcal.html http://www.lauper.cc/gcal/gcal-fixed.html The file adds a json event source and one for a google calendar. If you first remove the google event source and then add it again, you will see these events twice. Clicking "Add cal and refetch" several times will add the events again and again - which is also fixed in fullcalendar-fixed.js. I use this functionality in one of my applications where one click needs to add/remove one or more Google eventSources and refetch the events, as this click also changes the display of events retrieved through a JSON event source.
Oct 7, 2010
(No comment was entered for this change.)
Status:
Reproducing
Oct 11, 2010
(No comment was entered for this change.)
Summary:
addEventSource renders events twice
Status: Accepted Labels: Type-Defect
Oct 16, 2010
this has been fixed in version 1.4.8 (just released). thanks!
Status:
Fixed
Aug 13, 2013
(No comment was entered for this change.)
Status:
Implemented
Aug 13, 2013
(No comment was entered for this change.)
Status:
Released
|
|
| ► Sign in to add a comment |