0

I have a server where I notify other clients that a fullcalendar event has been modified, removed or added. Modifying and adding works without any issues but when I try to remove an event within the eventsource listener, every event dissappears. Someone know why? I'm using the angularJS fork of fullcalendar and the code to delete an event within an eventsource listener looks like this. I've also tried to delete every event and query my database for new events but the fullcalendar won't render anything unless a full website reload is executed.

var source = new EventSource("/events");
var deleteEventHandler = function(event){
        obj = JSON.parse(event.data);
        if(obj.user != $scope.vpodUser){
        uiCalendarConfig.calendars.myCalendar.fullCalendar('removeEvents', obj.id);
        }
    };
    source.addEventListener("deleteEvent", deleteEventHandler, false);
  • check evensource with console.log whether t has removed all events – rashidnk May 21 '16 at 04:32
  • I checked the events array and the eventsources array before and after removing. They seem to have the same amount of events before and after. If an event is removed without using Server-Sent Events it will be removed and from the calendar's rendering even though the events array stay the same during console.log – FlowerPower1990 May 21 '16 at 10:25
  • 1
    try this after delete .fullCalendar( 'rerenderEvents' ) – rashidnk May 21 '16 at 11:12

0 Answers0