| Issue 1062: | Only fetch event source once (even if it has been added twice) | |
| 3 people starred this issue and may be notified of changes. | Back to list |
Okay, so I wanted to change the data thats sent in the POST of the AJAX request, that fetches the json data... so I did this:
var events_source = {
url: "ajax.php?file=calendar_events_json",
type: "GET",
data: {
variable_data: 'blah blah foo bar lol'
}
};
$('#calendar').fullCalendar({..., events: events_source, ...});
When I want to change variable_data, the only way I could manage it was by doing this:
function do_something() {
events_source.data.variable_data = 'something';
$('#calendar').fullCalendar('removeEventSource', events_source);
$('#calendar').fullCalendar('addEventSource', events_source);
}
The problem is when do_something() is called twice within about 1 second. It seems that the addEventSource is getting the data via AJAX twice, and showing duplicate data. Not sure how I can fix this.
Sep 8, 2011
Okay thanks! Hopefully you fully understand what I was doing. The real world example of this, is that I had a "Filter by Event Type" dropdown. When dropdown is changed, tell fullCalendar to refetch that month's events via JSON.
Oct 9, 2011
yea...I need to post to server by eventsource,however the param is static after initialed.I tried long... well,it's really a big issue!hope could be fixed for it's really enhancable func!
Aug 13, 2013
(No comment was entered for this change.)
Status:
Discussing
Labels: -Type-Defect Type-BehaviorMod
Aug 14, 2013
I think a better solution is to solve the issue presented in issue 878 , rather than make some special case for this removeEventSource/addEventSource
Status:
WontFix
Labels: -Type-BehaviorMod Type-Behavior |
|
| ► Sign in to add a comment |
Status: Maybe