javascript - FullCalendar Scheduler 事件未显示在 TimelineView 中

标签 javascript fullcalendar fullcalendar-scheduler

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

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/

相关文章:

javascript - Webpack 无法解析文件或 dic

jquery - 使用 FullCalendar 自定义月 View

fullcalendar - 在周 View 中仅显示特定时间范围

javascript - 全日历事件总是出现在全天事件时段以及如何编辑

css - Fullcalendar 事件具有不饱和的背景颜色

javascript - FullCalendar Scheduler 计时定制

javascript - FullCalendar 单击编辑资源

javascript - IIFE vs bind() 用于事件/回调函数

javascript - 是否可以通过 Tampermonkey 脚本修改响应 header ?

javascript - 是否可以同时运行 jQueryUI 和 Mootools?