Update Fullcalendar on onChange from a select

Asked

Viewed 257 times

0

I have a select html in my page header that lists some people in the database, when one of them is chosen, I take his ID and store it in a JS variable and send this variable by AJAX to my php, where I use some Static functions that require that person’s id to fetch data about them in the database, it comes in an array.

I take this array and put a foreach passing the some table information to the event in fullcalendar. I rescan these events in my list view. In the Month view, I rescan the result of another Function which does the same thing as the first, but select comes from another table.

I use viewRender to change the rendering of the event arrays according to the selected view, but it occurs to me that if I change from one person to another, the data is not updated.

I’ve tried removing events, adding and re-rendering, but it wasn’t.

The 'Month' view remains correct, but the view list does not change if I change the person, it always continues with the events referring to the first person who was selected.

Any idea how I can remove the TWO ARRAYS events and re-render when I change person in my combo?

1 answer

0

You would have to remove the events and render again.

Example:

$('#calendar').fullCalendar('removeEvents');
$('#calendar').fullCalendar('addEventSource', data);
$('#calendar').fullCalendar('rerenderEvents');

Browser other questions tagged

You are not signed in. Login or sign up in order to post.