Issue 1643: FullCalendar jQuery plug-in fires ajax events for every event (hover, mouseover, resize, ect…) when lazyFetching is set to false
Status:  Invalid
Owner: ----
Closed:  Aug 2013
Reported by obbio...@gmail.com, Dec 13, 2012
I'm using FullCalendar to display events, which I'm getting through a javascript function that makes an AJAX call. This is done to send a limiter on how many events to pass back for a given day, with a ViewMore option included.

By turning off lazyFetching, the result seems to be that FullCalendar does a re-render for every event that's fired on the page. This results in it doing a new AJAX call each time.

How can I prevent FullCalendar from making these unnecessary AJAX calls?

below is the code for initializing my fullCalendar. Thanks!

 $('#calendar').fullCalendar({
    defaultView: 'basicWeek',
    theme: true,
    contentHeight: 800,
    weekends: true,
    header: {
        left: 'prev,next today',
        center: 'title',
        right: 'month,basicWeek,basicDay'
    },
    lazyFetching: false,
    columnFormat: {
        month: 'ddd',
        week: 'ddd ' + shortMonthDayPattern,
        day: 'dddd ' + shortMonthDayPattern
    },
    titleFormat: {
        month: yearMonthPattern,                             // September 2009
        week: "MMM d[ yyyy]{ '—'[ MMM] d yyyy}", // Sep 7 - 13 2009
        day: longDatePattern                  // Tuesday, Sep 8, 2009
    },
    dayClick: function (date, allDay, jsEvent, view) {
        if (view.name != 'basicDay') {
            $('#calendar').fullCalendar('changeView', 'basicDay');
            $('#calendar').fullCalendar('gotoDate', date);
        }
    },
    eventClick: function (event, jsEvent, view) {
        if (event.id === "viewMore") {
            $('#calendar').fullCalendar('changeView', 'basicDay');
            $('#calendar').fullCalendar('gotoDate', event.start);
        }
        else {
            navigateBackboneCal(event.id);
        }
    },
    editable: false,
    loading: function (isLoading) {
        if (isLoading) {
            $('.fc-content').block({
                message: null,
                css: { top: '10' }
            });
        }
        else {
            $('.fc-content').unblock();
        }
    },
    events: function (startDt, endDt, callback) {
        var maxEvents = 0;
        var view = $('#calendar').fullCalendar('getView');
        if (view.name === 'month')
            maxEvents = 5;
        else if (view.name === 'basicWeek')
            maxEvents = 30;

        var events = [];
        $.ajax({
            url: '/GetCalendarEvents',
            type: 'POST',
            data: { start: Math.round(startDt.getTime() / 1000), end: Math.round(endDt.getTime() / 1000), maxEvents: maxEvents },
            error: function (error) {
                alert('There was an error while fetching events!');
                $('.fc-content').unblock();
            },
            success: function (result) {
                if (result.viewMoreEvents)
                    events = $.merge(result.events, result.viewMoreEvents);
                callback(events);
            }
        });


    }
});
Aug 18, 2013
Project Member #1 adamrs...@gmail.com
(No comment was entered for this change.)
Status: ReproTemp
Aug 25, 2013
Project Member #2 adamrs...@gmail.com
This message is being bulk-sent to a number of issues, both [very] old and new.

I have been working on taming this issue tracker, which has gotten out of control after months of neglect. You are receiving this message because I could not successfully reproduce the bug you were reporting with a reasonable amount of effort. I have written some new bug-report guidelines to be used by all bug reports going forward:

    http://arshaw.com/fullcalendar/wiki/Report-a-Bug/

Its salient point is that all bug reports should have an isolated demonstration, viewable online with a tool like JSFiddle.

If the bug you originally reported is still important to you, could you please first try the latest version of FullCalendar and see if it is fixed? If not, could you please file a NEW bug report that follows the new guidelines? This issue will not be monitored for further comments.

I'm sorry I have taken so long to respond to many of your request, and I'm sorry if this new procedure causes extra work for you. Going forward, the issue tracker will be much more of a well-oiled machine.

Again, if you must, PLEASE SUBMIT A *NEW* BUG REPORT (following the new guidelines) INSTEAD OF COMMENTING ON THIS ONE. Further comments on this report will be ignored. Thanks.
Status: Invalid
Labels: -Type-Defect Type-Bug