Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Implementing the loading callback with fullcalendar

Tags:

fullcalendar

Looking for an example of how to implement the loading callback.

Here is my code that I am using so far. Just not sure how to use the loading callback.

Do I need to use events as a function or can I add something to the code I am using here?

Thanks

$('#calendar').fullCalendar({
    theme: true,
    header: {
            left: 'prev,next today',
            center: 'title',
            right: 'month,agendaWeek,agendaDay'
    },
    editable: true,

    events: {
            url: 'calendar/ajax.php',
            data: {
                uid: '<?=$_SESSION[$pageID]['owner_uid']?>',
                fbpageid: '<?=$pageID?>'
            },
            error: function() {
                alert('there was an error while fetching events!');
            }
        },

    eventMouseover: function(calEvent,jsEvent) {
        xOffset = 10;
        yOffset = 10;
        var left = (jsEvent.clientX + yOffset);
        if ( (jsEvent.clientX + 200 + yOffset) > $(window).width() ){
            left = (jsEvent.clientX - 200);
        }
        $("body").append(calEvent.tooltip);
        $("#p_"+calEvent.id)
                .css("top",(jsEvent.clientY - xOffset) + "px")
                .css("left",left + "px")
                .fadeIn("fast");
    },
    eventMouseout: function(calEvent,jsEvent) {

            $("#p_"+calEvent.id).fadeOut("fast");   
            $("#p_"+calEvent.id).remove();
    }
});
like image 841
randy Avatar asked Aug 20 '12 17:08

randy


1 Answers

Here is an example of how to use the loading callback:

loading: function(bool) {
  if (bool) 
    $('#loading').show();
  else 
    $('#loading').hide();
},
like image 109
ews2001 Avatar answered Sep 28 '22 07:09

ews2001