Tuesday, December 1, 2009

[jQuery] Full Calendar Plugin -- removing event source when it is a function

Full Calendar: http://arshaw.com/fullcalendar/

I am trying to reference the event source that I have added via a
function. I have the following function, when I addEventSource the
new events are added to the calendar. But i can't seem to get the
correct reference to removeEventSource. As you see i create a var
source3 (which executes successfully), then I add to the event object
and it appears on calendar, but it does not get removed.

I figure I must not be using the correct reference. Any ideas?


source3 = function addanothersource(start, end, callback) {

$.ajax({
type: 'POST',
url: newUrl,
data: str,
success: function(respData){
eventArray = respData;
callback(eventArray);

}
});
};


$('#calendar').fullCalendar('addEventSource', source3);

$('#calendar').fullCalendar('removeEventSource', source3);

No comments: