Search code examples
jqueryfullcalendarqtipqtip2

Qtip on fullcalendar agendaweek view


I have a fullcalendar implementation where Qtip is used to display a tooltip when an event is clicked, through the eventRender callback, as follows:

eventRender: function(event, element) {
    element.qtip({
        content: {
            text: 'Hello world'
        },
        position: {
            my: 'left center',
            at: 'right center'
        },
        show: {
            solo: true,
            event: 'click'
        },
        hide: 'click unfocus'
    });
}, 

How would one go about displaying a tooltip on an empty slot when it is clicked in agendaweek (or agendaday) views?

I have tried using Qtip in both the dayClick and select callbacks to no avail - I can find no way to make a tooltip show next to the cell that was clicked as neither of these callbacks have the element variable to assign the qtip to?


Solution

  • For an "empty slot" you will want to use dayClick instead of eventRender - because that's for events already in the calendar.

    So using your example my dayClick would look like this:

    dayClick: function(date, jsEvent, view) {
                $(this).qtip({
                    content: {
                        text: 'Hello world'
                    },
                    position: {
                        target: [jsEvent.pageX,jsEvent.pageY]
                    },
                    show: {
                        ready: true,
                        solo: true
                    },
                    hide: 'unfocus'
                });
            }
    

    Hope that helps.