The problem:
fullCalendar does not update events using .fullCalendar('refetchEvents')
after succesfull AJAX call.
Using
- MSIE 11.0.41 (11.0.9600.18638) -- problem occurs
- FireFox 53.0 (32-bit) -- problem does not occur
- Chrome 58.0.3029.81 (64-bit) -- problem does not occur
- VS2015, C# MVC on localhost, IIS Express
- fullcalendar.js v3.3.0
- jquery-3.1.1.js
- jquery-ui-1.12.1.js
Description of symptoms:
When inserting a new event into fullCalendar by using below $.ajax
call
$.ajax({
type: 'POST',
url: '@Url.Action("SaveEvent","Calendar")',
data: dataRow,
success: function (response) {
if (response == 'True') {
$('#_Calendar').fullCalendar('refetchEvents');
alert('New event saved!');
}
else {
alert('Error, could not save event!');
}
}
});
When the callback comes, the 'refetchEvents'
method of fullCalendar will only fire -in MSIE 11- if the debugger/developer window is open. It doesn't matter if there is an actual breakpoint set, only having the debugger/developer window open makes the routine work ?
Even triggering the 'refetchEvents'
completely separate from the $.ajax
call has the same behaviour. I.E. if I trigger a function as below:
<button type="button" class="btn" onclick="fetchEvents(); return false;">trigger</button>
with function:
function fetchEvents() {
$('#_Calendar').fullCalendar('refetchEvents');
}
The effect is exactly the same, the 'refetchEvents' will only fire -in MSIE 11- if the debugger/developer window is open ?
I thought it might be a timing problem, hence my manual trigger option, yet the behaviour is the same even though the 'refetchEvents'
call is way after the event has been inserted. Even page-refresh does not trigger the 'refetchEvents'
the refresh of the events only fires -in MSIE 11- when debugger/developer window is open.
As indicated, no other browser on any platform (that I have tested) has the same result ? (FireFox/Chrome/Safari/Android[Chrome & FireFox] all work flawless...)
Has anybody come across this behaviour and/or potentially have a solution ?
I would appreciate your input !