khizAz khizAz - 1 year ago 59
Javascript Question

jquery Full Calendar: callback 'after' the calendar has loaded completely

Is there a callback in Adam Shaw's jquery full calendar which is called after the calendar has rendered completely?? I want to call the clientEvents function in that call back to get all the events on the client side. I tried doing this in viewDisplay, but it is called before the events are rendered and the clientEvents returns 0 events.

Answer Source

Actually you can add it by yourself. Update the function render in the fullcalendar.js like this

function render(inc) {
    if (!content) {
        trigger('complete', null, true);
        trigger('complete', null, true);

And add to the initial call callback function:

         editable: true,
         complete: function() {alert('complete');}, 

or, as you wanted, you can access all events

    complete: function() {
        var events = $(this).fullCalendar('clientEvents');
        for(var i in events)