laravel-fullcalendar icon indicating copy to clipboard operation
laravel-fullcalendar copied to clipboard

Not being able to refetchEvents

Open LuisMCunha opened this issue 9 years ago • 4 comments
trafficstars

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.

LuisMCunha avatar Feb 12 '16 13:02 LuisMCunha

Hi @MoPHL Did you manage to solve this issue? Byron

Byronsargeant avatar Feb 27 '18 20:02 Byronsargeant

.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!

Byronsargeant avatar Mar 14 '18 21:03 Byronsargeant

or maybe a class can be set in the setOptions() and that could be targeted??

Byronsargeant avatar Mar 14 '18 21:03 Byronsargeant

$ ('#' + $ (". fc"). attr ('id')) fullCalendar ('removeEvents') works ok;

but with $ ('#' + $ (". fc"). attr ('id').) fullCalendar ('rerenderEvents') does not work, am I doing something wrong?

Helidalto avatar May 17 '18 20:05 Helidalto