2014-10-02 166 views
0

我使用fullcalender創建了一個日曆,其中顯示了所有事件(任務)。 現在我想打開一個顯示事件細節的表單,如何通過點擊它來獲取事件細節? 我的代碼:fullcalendar獲取有關事件點擊的事件詳細信息

<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> 

回答

0

查看完整的日曆文檔。這裏是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); 
     } 
    } 

}); 
相關問題