views:

209

answers:

3

I'm looking at using fullCalendar and using qTip to display a description using eventMouseover.

Has anyone managed to do this or know of a solution? I've google'd and also tried implementing this post but i've had no joy. The only time I got it to work it got into a loop and crashed my browser.

Any advice / support would be greatly appreciated.

Von Schmytt.

UPDATED: Here's the code i'm starting off with (aware it's an example script but, if I could get qTip integrated I could progress). I have qTip, etc ready to use. I just don't know where to start with this now? Thanks again.

UPDATED: 15th July 2010. Can anyone help please?

<script type='text/javascript'>

     $(document).ready(function() {

      var date = new Date();
      var d = date.getDate();
      var m = date.getMonth();
      var y = date.getFullYear();

      $('#calendar').fullCalendar({
       theme: false,
       header: {
        left: 'prev,next today',
        center: 'title',
        right: 'month,agendaWeek,agendaDay'
       },
       editable: false,
       events: [
        {
         title: 'All Day Event',
         start: new Date(y, m, 1),
                        description: 'Blah blah blah blah blah blah blah'
        },
        {
         title: 'Long Event',
         start: new Date(y, m, d-5),
         end: new Date(y, m, d-2),
                        description: 'Blah blah blah blah blah blah blah'
        },
        {
         title: 'Meeting',
         start: new Date(y, m, d, 10, 30),
         allDay: false,
                        description: 'Blah blah blah blah blah blah blah'
        }
       ]
      });
     });

    </script>
A: 

While I have not used qtip specifically, I did something close to what you did using the eventRender callback like stated here.

Your code should look something like:

$('#calendar').fullCalendar({
events: [
    {
        title: 'My Event',
        start: '2010-01-01',
        description: 'This is a cool event'
    }
    // more events here
],
eventRender: function(event, element) {
    element.qtip({
        content: event.description
    });
}

});

Let me know if that helps at all, otherwise once I get home tonight I can have a closer look.

Nick-ACNB
Thanks for help but I've found that eventRender doesn't play ball with qTip. viewDisplay seems to be the way forward but how... I don't know. Any other form of ToolTip would be just as good for what I need.Thanks againPVS
Von Schmytt
A: 

I'd recommend checking out http://craigsworks.com/projects/forums/thread-google-calendar-like-bubble-for-jquery-fullcalendar.

I've got it working (sort of) with this


      viewDisplay: function(view) { 
         var calendar = $(this);
     alert('Google calendars loaded');
         $('.fc-event').each(function(){
            // Grab event data
            var title = $(this).find('.fc-event-title').text(),
               data = calendar.data('fullCalendar').clientEvents(function(event){
                  return event.title === title;
               })[0];
            var qtipContent = data.description ? data.description : data.title;
            $(this).qtip({
               content: qtipContent,
               position: {
                  corner: {
                     target: 'topRight',
                     tooltip: 'bottomLeft'
                  }
               },
               show: 'mouseover',
               hide: 'mouseout',
               style: {
                 width: 200,
                 padding: 5,
                 background: '#A2D959',
                 color: 'black',
                 textAlign: 'center',
                 border: {
                    width: 7,
                    radius: 5,
                    color: '#A2D959'
                 },
                 tip: true
               }
            });
         });
         return false;
    },

It's sort of working in that my qtips don't happen without that alert (no idea why yet). Also, mine's only working in Firefox and IE6 (how frikkin weird is that!).

Sunset Bill
I'm rubbish at this. Not having any joy what so ever! :-(
Von Schmytt
What version of jquery are you using? I was flailing and failing miserably trying this with jquery 1.4.2, switched to jquery 1.3.2 and things started happening. Still can't get it working for IE7 or Opera (don't have Safari to test), and I don't get anything if I take out that silly alert.
Sunset Bill
I've tried it with jQuery 1.3.2 as spotted that in a previous blog but just not having any joy. As per previous comment... i'm rubbish at this. :-)
Von Schmytt
I hear ya. I've had to give up on it for now myself, since I've got a deadline and can still only get it to work in the two aforementioned browsers (no IE7, Safari, Opera or Chrome) via that annoying alert.
Sunset Bill
Likewise. Given up on it as deadline has been and gone. Sadly that nice feature won't be on the live site. Thanks for your help all the same. PVS
Von Schmytt
A: 

Try downloading jquery.qtip-1.0.js

The RC's don't seem to work but 1.0 does (I found that on another forum). I have QTip working with this code:

    eventRender: function (event, element) {
        element.qtip({    
            content: {    
                title: { text: event.title },
                text: '<span class="title">Start: </span>' + ($.fullCalendar.formatDate(event.start, 'hh:mmtt')) + '<br><span class="title">Description: </span>' + event.description       
            },
            show: { solo: true },
            //hide: { when: 'inactive', delay: 3000 }, 
            style: { 
                width: 200,
                padding: 5,
                color: 'black',
                textAlign: 'left',
                border: {
                width: 1,
                radius: 3
             },
                tip: 'topLeft',

                classes: { 
                    tooltip: 'ui-widget', 
                    tip: 'ui-widget', 
                    title: 'ui-widget-header', 
                    content: 'ui-widget-content' 
                } 
            } 
        });
    }    
orolo
Woohoo! Thank you for this. It works.
Von Schmytt
For all struggling... Download qTip from http://bazaar.launchpad.net/~craig.craigsworks/qtip/1.0/files. Then you'll be ready to rock and roll.
Von Schmytt