FullCalendar Scheduler 事件未显示在 TimelineView 中

FullCalendar Scheduler Events are not showing in TimelineView

我已经创建了一个包含以下事件和资源的调度程序

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) {

                        });

事件在月视图中显示,但在日视图中未显示。谁能告诉我问题出在哪里?

在JavaScript中,变量和属性名称区分大小写。因此

'resourceid': '27'` 

应该是

'resourceId': '27'

per the example in the documentation。该事件未显示时间线视图,因为就 fullCalendar 而言,您没有告诉它要将其关联到哪个资源。

                            resources: sampleEvents,
                            events: sampleResources,

你填错了。切换它们。它会起作用。

                            resources: sampleResources,
                            events: sampleEvents,

分配的对象不正确。如果你传递了正确的对象。它将正常工作

resources: sampleResources,
 events: sampleEvents

你可以参考下面的工作jsfiddle link

http://jsfiddle.net/jso51pm6/3769/