fullcalendar调度程序仅允许在后台事件中进行选择

时间:2018-07-09 06:01:28

标签: javascript html fullcalendar

我只允许在设置的后台事件中进行选择。因此,我在https://fullcalendar.io/docs/selectOverlap中找到了一些东西。但是,它对我不起作用。

events: [
    {
        id : '1',
        start: '11:00',
        end: '18:30',
        color: 'gray',
        rendering: 'background',
        dow: [1],
        resourceId: "jenny"
    },
    {
        id: '2',
        start: '14:30',
        end: '22:30',
        color: 'gray',
        rendering: 'background',
        dow: [3],
        resourceId: "tom"
    }
],
selectOverlap: function(event) {
    return event.rendering === 'background';
}

即使这样做,我仍然可以选择所有插槽。

+) 另外,我尝试使用businessHours,但无法区分资源。

resources: [
            { id: 'a', title: 'A' },
            { id: 'b', title: 'B', eventColor: 'green' },
            { id: 'c', title: 'C', eventColor: 'orange' },
            { id: 'd', title: 'D', eventColor: 'red' },
            { id: 'e', title: 'E', eventColor: 'blue'}
        ],
        resourceAreaWidth: "10%",

        selectConstraint : "businessHours", 
         businessHours: 
         [
          {
            dow: [ 1, 2, 3 ], 
            start: '11:00', 
            end: '18:00',
            resourceId : "a" 
          },
          {
            dow: [ 4, 5 ], 
            start: '10:00', 
            end: '16:00',
            resourceId: "b" 
          }
         ]

我为每个资源设置了不同的businessHours,但是对于所有资源,结果都是相同的businessHour。 result

0 个答案:

没有答案
相关问题