裝載事件中,我開始日曆下面的代碼:問題通過AJAX
var calendar = $('#calendar').fullCalendar({
slotDuration: '00:15:00', /* If we want to split day time each 15minutes */
minTime: '00:00:00',
maxTime: '24:00:00',
header: {
left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek,agendaDay'
},
// events: allevents,
events: '/app/Http/Controllers/api/calendarController.php?action=getEvents&calendar_id=<?php echo $calendarid; ?>',
editable: true,
eventStartEditable: true,
droppable: true, // this allows things to be dropped onto the calendar !!!
})
其中我打電話將返回JSON類似控制器:
[
{"id":1,"title":"Test","start":"7-02-2017 15:36","end":"7-02-2017 15:36","className":null,"description":null},
{"id":2,"title":"test","start":"6-02-2017 11:00","end":"6-02-2017 12:00","className":null,"description":null},
{"id":3,"title":"asdadsadasd","start":"30-01-2017 12:00","end":"30-01-2017 12:00","className":"bg-green","description":"asdasdasas"},
{"id":4,"title":"sadsadsa","start":"31-01-2017 12:00","end":"31-01-2017 13:00","className":"bg-blue","description":"asasds"}
]
的問題是,由於某種原因數據沒有顯示在日曆上?
感謝您的任何答案。
額外注:我正在運行FullCalendar V2.0.0-β2
您是否收到任何javascript錯誤? –
沒有在javascript控制檯 – user3402600
我可以看到實際的json是當你去那個網址時返回? –