fullcalendar获取事件点击的事件详细信息

时间:2014-10-02 14:32:59

标签: fullcalendar

我使用fullcalender创建了一个日历,所有事件(任务)都显示在日历上。 现在我想打开一个显示事件详细信息的表单,如何通过点击它来获取事件详细信息? 我的代码:

<script>

    $(document).ready(function () {



        $('#calendar').fullCalendar({
            header: {
                left: 'prev,next today',
                center: 'title',
                right: 'month,agendaWeek,agendaDay'
            },
            defaultDate: '2014-09-12',
            editable: true,
            eventLimit: true, // allow "more" link when too many events
            events: [

                {
                    title: 'Meeting',
                    start: '2014-09-12T10:30:00',
                    end: '2014-09-12T12:30:00'
                }
            ]
        });

    });

</script>
<style>

body {
    margin-top: 40px;
    text-align: center;
    font-size: 13px;
    font-family: "Lucida Grande",Helvetica,Arial,Verdana,sans-serif;
}

#calendar {
    width: 900px;
    margin: 0 auto;
}

</style>
</head>
<body>
<div id='calendar'></div>
</body>

1 个答案:

答案 0 :(得分:1)

查看完整的日历文档。这是 link

 $('#calendar').fullCalendar({
     header: {
         left: 'prev,next today',
         center: 'title',
         right: 'month,agendaWeek,agendaDay'
     },
     defaultDate: '2014-09-12',
     editable: true,
     eventLimit: true, // allow "more" link when too many events
     events: [

         {
             title: 'Meeting',
             start: '2014-09-12T10:30:00',
             end: '2014-09-12T12:30:00'
         }
     ],
     eventClick: function(event) {
         if (event.title) {
             alert(event.title);
         }
     }

 });