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

前端 未结 4 1934
梦如初夏
梦如初夏 2021-01-11 16:12

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 b

4条回答
  •  北海茫月
    2021-01-11 17:01

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

    function render(inc) {
        if (!content) {
            initialRender();
            trigger('complete', null, true);
        }else{
            calcSize();
            markSizesDirty();
            markEventsDirty();
            renderView(inc);
            trigger('complete', null, true);
        }
    } 
    

    And add to the initial call callback function:

    $('#calendar').fullCalendar({
             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)
            {
                alert(events[i].title);
            }
        },
    

提交回复
热议问题