是否可以在 js 中通过 fullCalendar 拖放一整天(全天事件)
Is it possible to drag and drop an entire day (all day events) thorugh fullCalendar in js
-我需要拖放当天的所有事件,我在这里将其作为当天的时间表,当我拖动该时间表时,它应该能够将一天中的所有事件拖放到另一天我们 select.
如果您使用 groupId
属性(请参阅 https://fullcalendar.io/docs/event-object)将事件放入同一组,则可以在一个操作中将它们一起拖动和调整大小。
在下面的示例数据中,组 ID 1
的所有事件都可以作为一个拖动。
events: [
{
title: "Sales Meeting",
start: "2020-04-02 10:30",
end: "2020-04-02 11:30",
allDay: false,
groupId: 1
},
{
title: "Marketing Meeting",
start: "2020-04-02 11:30",
end: "2020-04-02 11:30",
allDay: false,
groupId: 1
},
{
title: "Production Meeting",
start: "2020-04-02 15:30",
end: "2020-04-02 16:30",
allDay: false,
groupId: 1
},
{
title: "Management Meeting",
start: "2020-04-02 13:30",
end: "2020-04-02 14:30",
allDay: false,
groupId: 2,
color: "green"
}
]
现场演示:https://codepen.io/ADyson82/pen/bGVbLpr - 将任何蓝色事件拖到第二天,当您释放鼠标时,您会看到所有其他事件也随之移动。
-我需要拖放当天的所有事件,我在这里将其作为当天的时间表,当我拖动该时间表时,它应该能够将一天中的所有事件拖放到另一天我们 select.
如果您使用 groupId
属性(请参阅 https://fullcalendar.io/docs/event-object)将事件放入同一组,则可以在一个操作中将它们一起拖动和调整大小。
在下面的示例数据中,组 ID 1
的所有事件都可以作为一个拖动。
events: [
{
title: "Sales Meeting",
start: "2020-04-02 10:30",
end: "2020-04-02 11:30",
allDay: false,
groupId: 1
},
{
title: "Marketing Meeting",
start: "2020-04-02 11:30",
end: "2020-04-02 11:30",
allDay: false,
groupId: 1
},
{
title: "Production Meeting",
start: "2020-04-02 15:30",
end: "2020-04-02 16:30",
allDay: false,
groupId: 1
},
{
title: "Management Meeting",
start: "2020-04-02 13:30",
end: "2020-04-02 14:30",
allDay: false,
groupId: 2,
color: "green"
}
]
现场演示:https://codepen.io/ADyson82/pen/bGVbLpr - 将任何蓝色事件拖到第二天,当您释放鼠标时,您会看到所有其他事件也随之移动。