Skip to content Skip to sidebar Skip to footer

Fullcalendar: Keep Event Properties After Previous/next Click

Goal: I am using Fullcalendar with the agendaWeek view. What I need to do is to click on a couple of events from a certain week (to change their color) and then click next to go to

Solution 1:

The solution for this problem in case someone else faces it is that Fullcalendar, when working with a JSON generated data from URL, the events will be refetched from the URL each time you go to another week using next/previous, thus the event properties will be reset. The solution is to actually have an array for the event source. I discovered this by going into the javascript file and reading part of the code. It have tried it with an array and it did not result in the same error, though I tried it on a small array, I will try it on a large dataset and see if it is a success.

Solution 2:

I've had same problem using fullcalendar. I noticed if you call to renderEvent method:

app.calendarObj.fullCalendar("renderEvent", {
      "start": "someDateTime",
      "end": "otherDateTime"
    });

And you add true as second parameter in this method event will keep on your calendar even when you change trough months.

app.calendarObj.fullCalendar("renderEvent", {
      "start": "someDateTime",
      "end": "otherDateTime"
    },true);

Solution 3:

Try to force fullcalendar to update the event after modifying it:

this.$("#calendar").fullCalendar('updateEvent', calEvent);

If the issue remains, maybe fullcalendar is not getting the right reference.. Then, try this:

// get specif event (reference)var specificEvent = $('#calendar').fullCalendar('clientEvents', calEvent.id);
this.$("#calendar").fullCalendar('updateEvent', specificEvent);

Post a Comment for "Fullcalendar: Keep Event Properties After Previous/next Click"