My favorites | Sign in
Project Home Issues
New issue   Search
for
  Advanced search   Search tips   Subscriptions
Issue 221: bug immediately removing event source after adding, leaves events
1 person starred this issue and may be notified of changes. Back to list
Status:  Released
Owner:  ----
Closed:  Aug 2013


Sign in to add a comment
 
Reported by koz...@gmail.com, Dec 1, 2009
[also posted on JQuery google group, couldn't find one for this specifically]

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(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); 

Dec 4, 2009
Project Member #1 adamrs...@gmail.com
is your example really working? looks like it wouldn't even display the events.. the
'dataType' in your $.ajax call needs to be 'json'. otherwise, you are just giving a
raw string to 'callback', which fullcalendar doesn't know how to handle. let me know
if this is the problem
Dec 4, 2009
#2 koz...@gmail.com
Well yes the ajax wasn't working so i switched to getJSON ajax method, which works. 
[Sorry that was an unfinished method that i happened to copy/paste. The current one
is below].  However, I still can't remove the source.

Anyway, is this the correct reference to add then remove source?  If not, could you
provide an example that uses a function.  Thank you!  I appreciate the reply.

source3 = function(start, end, callback)
		{
				//alert(" data fetched from "+start+" till "+end);
				$.getJSON("/msasProject/portlet/MSCalendar/loadEvents.do",
					{
						start: start.getTime(),
						end: end.getTime()
					},
					function(calevents)
					{
						eventJSON = calevents;
						callback(eventJSON);

					}
				);
		}

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

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

Dec 4, 2009
#3 koz...@gmail.com
btw - in the example above, just to confirm, the addEventSource is adding events
successfully to the calendar. It just isn't removing.
Dec 9, 2009
Project Member #4 adamrs...@gmail.com
hi kozefx,
you are right, i have reproduced this situation, it is a bug. it is happening b/c the
removeEventSource is so soon after the addEventSource. if you have the
removeEventSource triggered by something that is not immediately after (like a user's
click), you wont have a problem.

this is a legit bug and i will get it fixed in the next minor release. thanks for the
report!
Summary: bug immediately removing event source after adding, leaves events
Status: Accepted
Dec 22, 2009
Project Member #5 adamrs...@gmail.com
ok, this should be fixed in 1.4.3 (just released) thanks a lot for your help
Status: Fixed
Aug 13, 2013
Project Member #6 adamrs...@gmail.com
(No comment was entered for this change.)
Status: Implemented
Aug 13, 2013
Project Member #7 adamrs...@gmail.com
(No comment was entered for this change.)
Status: Released
Sign in to add a comment

Powered by Google Project Hosting