Right then, I'm using FullCalendar to display events from multiple sources, some local JSON feeds, others from Google Calendar. I've implemented a feature whereby a single calendar can be displayed / hidden when it's checkbox is true or false respectively.
I'm using this code to achive it:
$('#calendar_list input','#sidebar').live('click', function() {
if($(this).is(":checked")==true) {
// display the calendar
var source = $.fullCalendar.gcalFeed("http://www.google.com/calendar/feeds/usa__en%40holiday.calendar.google.com/public/basic");
$('#calendar').fullCalendar('addEventSource', source);
} else {
// remove the calendar
var source = $.fullCalendar.gcalFeed("http://www.google.com/calendar/feeds/usa__en%40holiday.calendar.google.com/public/basic");
$('#calendar').fullCalendar('removeEventSource', source);
}
});
This example if just to show / hide a Google Calendar feed, the problem is it never hides the calendar again... if I click the check box 10 times, (1=off, 2=on, 3=off, 4=on etc) it displays 5 versions of the same calendar.
The documentation doesn't really seem to give many clues and it seems this problem has plauged a few on the Google Project site for the project.
How to I remove an event souce?! *cries*
Any help would be appreciated.