views:

464

answers:

3

Has anybody had any luck getting FullCalendar to work with jQuery's ThickBox?

When somebody clicks on a FullCalendar event, I would like the event details to open into a ThickBox window.

Any idea how to get them to work together?

+1  A: 

b/c fullcalendar dynamically creates those after document ready, thickbox isn't able to attach its own events to it, so it doesnt work. you need to explicitly tell thickbox to attach its events in eventRender (http://arshaw.com/fullcalendar/docs/event_rendering/eventRender/) with the tb_init function (which thickbox doesnt really document). something like this should work:

$('#calendar').fullCalendar({
   eventRender: function(event, element) {
      tb_init(element);
   }  
});

hope this helps

arshaw
A: 

Thank you, that kinda worked or at least got me pointed in the right direction.

All I needed to do was Init ThickBox by placing the following line of code after the Calendar closing "});"...

TB_init();

$(document).ready(function(){
    var date = new Date();
    var d = date.getDate();
    var m = date.getMonth();
    var y = date.getFullYear();
    $('#calendar').fullCalendar({
        header: {
            left: 'prev,next today',
            center: 'title',
            right: 'month,agendaWeek,agendaDay',
            firstHour: '6',
            minTime: '6',
            maxTime: '20'               
        },
        editable: false,
        events: [
            {
                title: 'All Day Event',
                start: new Date(y, m, 1)
            }       
    });
    TB_init();
});
Josh Breslow
A: 

Can one of you guys show me how to make thickbox work with my fullCalendar? Currently I have my events opening in a new window, but I would love to have them open in thickbox. Here's my existing code:

$(document).ready(function() {

    // page is now ready, initialize the calendar...

$('#calendar').fullCalendar({
    weekMode:'variable',
    events: $.fullCalendar.gcalFeed(
        "http://www.google.com/calendar/feeds/my_google_account/public/basic"
    ),
    eventClick: function(event) {
        if (event.url) {
        window.open(event.url,"_blank","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=750, height=450");
        return false;
        }
    }
});

});