새 FullCalendar 이벤트를 만들 때 이벤트와 함께 추가 속성을 포함 할 수있다. FullCalendar는 추가 속성을 무시하므로 스크립트를 추가하여 표시해야합니다. 다음과 같이 이벤트 위치 나 설명을 추가하는 예를 들어
이 수행 될 것이다 : 달력 스크립트를 초기화 할 때
var event = {
id : '123',
title : 'New Event',
url : 'http://thearena.com/',
start : "Sun, 18 Jul 2010 13:00:00 EST",
end : "Sun, 18 Jul 2010 17:00:00 EST",
allDay : false,
location : 'The Arena',
description : 'Big Event',
editable : true
};
$('.fc').fullCalendar('renderEvent', event, true) // Add Event to fullCalendar
// Add script here to post the event back to your server
그리고 있는지 확인이 추가 이벤트 정보를 표시 할 수있는 방법이있다. 다음은 경고 윈도우 (또는 facebox 라이트 박스 - 주석 처리 됨)의 데이터를 보여주는 이벤트 클릭 함수의 예입니다. 그리고 URL이 존재하면 그것은 새 탭/창에서도 열립니다.
$('.fc').fullCalendar({
eventClick: function(calEvent, jsEvent, view) {
var event = 'Event: ' + calEvent.title + '<br>' +
'Location: ' + calEvent.location + '<br>' +
'Start time: ' + calEvent.start + '<br>' +
'End time: ' + calEvent.end + '<br>' +
'Description: ' + calEvent.description;
alert(event);
// jQuery.facebox(event); // this would open the HTML in a facebox popup window
if (calEvent.url) {
window.open(calEvent.url);
return false;
}
});