我创建了一个包含以下事件和资源的调度程序
var sampleEvents = [{ 'id': '1',
'resourceid': '27',
'start': '2018-09-19T07:00:00',
'stop': '2018-09-19T16:00:00',
'title': 'Message 1',
}];
var sampleResources = [{
facility_type: "Message Type",
id: '27',
title: "Message 1"
}];
$('#calendar').fullCalendar({
schedulerLicenseKey: 'CC-Attribution-NonCommercial-NoDerivatives',
now: currenDate //Today's Date,
editable: false,
header: {
left: 'today prev,next',
center: 'title',
right: 'month,timelineDay,agendaWeek'
},
defaultView: 'month',
resourceGroupField: 'facility_type',
resourceColumns: [
{
labelText: 'Facility',
field: 'title',
width: 150,
},
],
resources: sampleEvents,
events: sampleResources,
dayClick: function(date, jsEvent, view) {
if(view.name == 'month' || view.name == 'basicWeek') {
$('#calendar').fullCalendar('changeView', 'timelineDay');
$('#calendar').fullCalendar('gotoDate', date);
}
},
});
}, function (error) {
});
事件在月 View 中显示,但在日 View 中不显示。谁能告诉我问题出在哪里?
最佳答案
在 JavaScript 中,变量和属性名称区分大小写。因此
'resourceid': '27'`
应该是
'resourceId': '27'
如per the example in the documentation 。该事件未显示时间线 View ,因为就 fullCalendar 而言,您没有告诉它与哪个资源关联。
关于javascript - FullCalendar Scheduler 事件未显示在 TimelineView 中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52401118/