0
這是我的整個Ajax響應:
{
"data": [
{
"id": 3,
"calendar_id": 1,
"title": "asdasd",
"start": "2017-06-20 14:06:00",
"end": "2017-06-20 16:06:00",
"allDay": 0,
"className": "bg-green",
"deleted_at": null
}
]
}
定義:
$('#calendar').fullCalendar({
slotDuration: //..
minTime: //...
maxTime: //..
defaultView: //...
defaultDate: //..
header: {
//...
},
eventSources: [
{
url: '/api/calendar_events/' + id,
type: 'GET',
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
},
error: function() {
alert('there was an error while fetching events!');
}
}
],
eventLimit: //..
selectable: //..
});
有什麼不對EventSources? fullcalendar已呈現,但未顯示任何事件。
注:我想使用eventSources而不是事件,因爲可以有多個源。