我正在使用fullcalendar v4,只是从调度程序resourceTimeGrid开始。处理资源时,我碰到了我将在这里描述的情况,并想问我的问题(之所以写这些行,是因为SO认为我的问题中没有足够的文字。
以下行为正常吗?即使使用resourceEditable = false,您也可以将事件切换到另一个资源
<html>
<head>
<link href='https://unpkg.com/@fullcalendar/[email protected]/main.min.css' rel='stylesheet' />
<link href='https://unpkg.com/@fullcalendar/[email protected]/main.min.css' rel='stylesheet' />
<link href='https://unpkg.com/@fullcalendar/[email protected]/main.min.css' rel='stylesheet' />
<script src='https://unpkg.com/@fullcalendar/[email protected]/main.min.js'></script>
<script src='https://unpkg.com/@fullcalendar/[email protected]/main.js'></script>
<script src='https://unpkg.com/@fullcalendar/[email protected]/main.js'></script>
<script src='https://unpkg.com/@fullcalendar/[email protected]/main.js'></script>
<script src='https://unpkg.com/@fullcalendar/[email protected]/main.min.js'></script>
<script src='https://unpkg.com/@fullcalendar/[email protected]/main.js'></script>
<script src='https://unpkg.com/@fullcalendar/[email protected]/main.js'></script>
</head>
<body>
<a>Drop the event one time to disable editable and resourceEditable for that event</a><br/>
<a>Test to put that event in the other resource : even with resourceEditable=false you can switch event to another resource</a>
<div id="calendarArea"></div>
<script>
var calendarEl = document.getElementById('calendarArea');
var today = new Date();
var month = (today.getMonth()+1) > 10 ? today.getMonth()+1 : '0'+(today.getMonth()+1);
var day = today.getDate() > 10 ? today.getDate() : '0'+today.getDate();
var todayStringStart = today.getFullYear()+'-'+ month+'-'+today.getDate()+'T08:00';
var todayStringEnd = today.getFullYear()+'-'+ month+'-'+today.getDate()+'T09:00';
var calendar = new FullCalendar.Calendar(calendarEl, {
plugins: [ 'interaction', 'resourceTimeGrid' ],
defaultView: 'resourceTimeGridWeek',
editable: true,
weekends: false,
eventResourceEditable: true,
scrollTime : '07:00:00',
schedulerLicenseKey: 'GPL-My-Project-Is-Open-Source',
resources: [
{
id: 'a',
title: 'Room A',
},
{
id: 'b',
title: 'Room B',
},
],
events: [
{
id: 'a',
title: 'my event',
start: todayStringStart,
end: todayStringEnd,
resourceId: 'a',
editable: true,
resourceEditable: true,
},
],
views: {
resourceTimeGridWeek: {
type: 'resourceTimeGrid',
duration: { week:1 },
},
resourceTimeGridMonth: {
type: 'resourceTimeGrid',
duration: { month:1 },
},
},
eventDrop: (info) => {
info.event.setProp('editable', false);
info.event.setProp('resourceEditable', false);
},
});
calendar.render();
</script>
</body>
</html>
我正在使用fullcalendar v4,只是从调度程序resourceTimeGrid开始。在处理资源时,我碰到了我将在这里描述的情况,并想问我的问题(我写了那些行...
是,应该(并且可能会),但是目前在库中有一个即兴的工作。