| Issue 2559: | Preventing EventSource duplicity | |
| 1 person starred this issue and may be notified of changes. | Back to list |
Hello, I'm trying to solve an issue with duplicity while refetching EventSources.
In best case scenario there will be request followed by response as shown in the first image attached.
In worst case scenario which I'm trying to solve, the response gets delayed and since the second response comes immediately after the first one, all the events will be rendered twice.
It my code I'm trying to make a use of loading callback where I'm incrementing variable for every request and decreasing for every response. After decreasing I'm checking if the variable is bigger than 0 (request got delayed) and if so, I'm calling removeEvents method.
var loading = 0;
function fullcalendar_loading(is_loading, view){
if(is_loading) {
loading++;
}
else {
loading--;
if(loading) {
$('#calendar').fullCalendar('removeEvents');
}
}
}
However this is not working our for me.
I'd LOVE to know if there's an option to stop loading or any other proper way to deal with duplicity.
Thanks for you response.
Aug 13, 2015
Project Member
#1
adamrs...@gmail.com
Status:
Done
Aug 13, 2015
Basically if fullcalendar compares the eventSources everytime when trying to add a new one, and stop adding it if theese two are exactly the same (same number of keys, same keys and their values). It would solve the problem. If you could point me where in the source code is this being processed. I would be able to solve it by myself. Also THANKS A LOT for your awesome plugin! I love it. |
|
| ► Sign in to add a comment |