How to refresh full calendar in js after the db changes?

93 Views Asked by At

I gone through many resources and documentation , still i faced only the errors in removing and adding the new events to fullcalendar .

Also i tried by using refetch events to refresh , still not worked for me .

var auto_refresh=setInterval(function()
{  $("#calendar").fullCalendar('refetchEvents');
},10000);

Also i tried this , it takes the data correctly but events couldnt add to the calendar

 var auto_refresh=setInterval(function()
    {
      var url_event='take_events.php?id='+ id +'$role='+ role;
        $("#calendar").fullCalendar('removeEvents'); 
         $("#calendar").fullCalendar('addEventSource', url_event); 
    
    },10000);
1

There are 1 best solutions below

0
Codingtime On

Here i solved by adding true to the addeventsource

$("#demo-calendar").fullCalendar('addEventSource', jsonval,true);

Please note that this will work for only 3. versions of fullcalendar.