I am trying to have fullCalendar reflect changes made to a database via AJAX. The problem is that it won't update the calendar on screen after a successful AJAX call.
$.ajax({ type: "POST", url: "eventEditXHR.php", data: { //the data }, success: function(text) { $("#calendar").fullCalendar("refetchEvents"); }....
I'm I using the wrong method? What would be the best way to accomplish this without having to reload the whole page? Thanks for any input!
Here is an example of how to specify an array of events: var calendar = new Calendar(calendarEl, { events: [ { title : 'event1', start : '2010-01-01' }, { title : 'event2', start : '2010-01-05', end : '2010-01-07' }, { title : 'event3', start : '2010-01-09T12:30:00', allDay : false // will make the time show } ] });
fullCalendar('render'); If you don't actually need to render the table, but just rerender the events again, you could use the 'rerenderEvents' method: $('#calendar'). fullCalendar('rerenderEvents');
This option is available from v2. 4.0 see fullcalendar.io/docs/text/displayEventTime - You need to set it as option of fullCalendar and it affects all events. Or use CSS . fc-time{ display : none; } .
We can get start date by getView event with intervalStart. We can get end date by getView event with intervalEnd. var month = $('#calendar'). fullCalendar('getView').
There are several ways. Some less elegant.
$('#calendar').fullCalendar({ events: "json-events.php", });
Just do:
$('#calendar').fullCalendar( 'refetchEvents' );
$('#calendar').fullCalendar( 'removeEventSource', source ) $('#calendar').fullCalendar( 'addEventSource', source )
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With