laravel-fullcalendar
laravel-fullcalendar copied to clipboard
Not being able to refetchEvents
I implemented the functionality to delete events from a popup window and I want to refresh the calendar without having to refresh the page, but so far haven't succeeded.
On the setCallbacks I added an eventClick to the events so that a popup appears after I click an event. If the user clicks yes, the event is deleted and I try to refresh the calendar, by following the official docs, calling this function:
function refreshCalendar() {
var calendar_id = $("div[id^=calendar-]").attr('id');
$('#' + calendar_id).fullCalendar('refetchEvents'); <---
}
Everything works except the .fullCalendar('refetchEvents') part, which doesn't seem to have any effect.
Do I have to do it in a specific way for it to work with laravel-fullcalendar or am I doing it incorrectly?
Thanks.
Hi @MoPHL Did you manage to solve this issue? Byron
.fullCalendar( ‘refresh’ ); .fullCalendar( ‘refetchEvents’ ); .fullCalendar( ‘rerenderEvents’ );
But the calendar ID is dynamically generated and is different each time the page loads it seems so will figure out a way to store the element using JS when its initially loaded and then call one of the above methods on the element as and when needed!
or maybe a class can be set in the setOptions() and that could be targeted??
$ ('#' + $ (". fc"). attr ('id')) fullCalendar ('removeEvents') works ok;
but with $ ('#' + $ (". fc"). attr ('id').) fullCalendar ('rerenderEvents') does not work, am I doing something wrong?