I’ve got a fullcalendar script running with an event filter for different locations in a dropdown. The filter works by sending the location requested to the server-side script which then returns a list of events for that location. Thus:
$('#calendar').livequery(function(){
var locationfilter = $('#locationfilter').val();
$(this).fullCalendar({
header: {left: 'prev,next today',center: 'title',right: 'month'},
defaultView:'month',
editable: false,
events: 'calendar_json.php?locationfilter='+locationfilter
});
$('#locationfilter').livequery('change',function(){
var locationfilter = $('#locationfilter').val();
$('#calendar').fullCalendar('removeEvents');
$('#calendar').fullCalendar('addEventSource', 'calendar_json.php?locationfilter='+locationfilter);
$('#calendar').fullCalendar('rerenderEvents');
});
However, my problem is that while this filters the events very well, when I change month it brings events back in for ALL locations and not just the one for the location selected. I tried rerendering using the viewDisplay callback, but that didn’t help, and just made the problem worse by duplicating them all as well.
Any ideas on how to make that happen? I’ve got the latest version of fullcalendar, but I’m still on Jquery 1.3.2 (for a number of reasons that I won’t go into)
http://code.google.com/p/fullcalendar/issues/detail?id=678
has a solution for this, it involves changing fullcalendar.js but it worked great for me.