开发者

FullCalendar with ThickBox

开发者 https://www.devze.com 2022-12-23 04:03 出处:网络
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 d开发者_Python百科etails to open into a ThickBox wi

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 d开发者_Python百科etails to open into a ThickBox window.

Any idea how to get them to work together?


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


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();
});
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号