我有一個從cfc返回JSON信息的頁面。該JSON是結構的數組,看起來像這樣:無法從JSON訂閱源在FullCalendar上呈現事件
[
{
"allday": true,
"title": "event1",
"userid": 1,
"end": "",
"classname": "",
"editable": true,
"start": "2010-09-01",
"id": 1,
"url": ""
},
{
"allday": true,
"title": "event2",
"userid": 1,
"end": "",
"classname": "",
"editable": true,
"start": "2010-09-10",
"id": 2,
"url": ""
}
]
當我使用:
$(document).ready(function() {
//Create JQuery connection to obj
$('#event').hide();
//Make event bubble draggable
$('#event').draggable();
$('#evBubbleClose').click(cleanEventBubble);
// page is now ready, initialize the calendar...
$('#calendar').fullCalendar({
// put your options and callbacks here
dayClick: function(date, allDay, jsEvent, view) {
createEvent(date, allDay, jsEvent, view, this);
},
events: 'http://xxxxx/cfc/FullCalendarEvents.cfc?method=getEvents',
theme: true,
header: {
left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek,agendaDay'
},
editable: true
});
});
該事件不渲染。不過,如果我在這裏複製並粘貼JSON數組中的JSON數組,它將顯示事件。我做錯了事件不會從Feed中呈現?
您是否將您的默認視圖設置爲月視圖?也許你的日曆沒有範圍內的日期,你餵它。只是猜測,因爲代碼似乎對我來說是正確的。 – Francisco 2010-09-23 17:12:35
是否在同一臺服務器上使用JSON?事件:'cfc/FullCalendarEvents.cfc?method = getEvents', – orolo 2010-09-24 20:12:07