The onEventMoved event handler fires when drag and drop event moving is completed in the JavaScript Calendar component, after the default action has been performed.
DayPilot.Calendar.onEventMoved(args)args.e (DayPilot.Event) - moved calendar event
args.newStart (DayPilot.Date) - new event start date/time
args.newEnd (DayPilot.Date) - new event end date/time
args.newResource (string | number) - new resource ID in Resources view
args.external (boolean) - true when the event was dragged from an external source; available for the DayPilot Pro external drag and drop scenario
args.ctrl (boolean) - Ctrl key status
args.shift (boolean) - Shift key status
The default action is configured using DayPilot.Calendar.eventMoveHandling. The default value is "Update", which renders the event at the new location before this event handler runs.
Use DayPilot.Calendar.onEventMove to inspect or modify the operation before the default action. This event is also available in the open-source version of the calendar component.
JavaScript
const calendar = new DayPilot.Calendar("dp", {
onEventMoved: (args) => {
console.log("Moved: " + args.e.text());
},
// ...
});
calendar.init();Angular
<daypilot-calendar [config]="config"></daypilot-calendar>config: DayPilot.CalendarConfig = {
onEventMoved: (args) => {
console.log("Moved: " + args.e.text());
},
// ...
};React
<DayPilotCalendar
onEventMoved={onEventMoved}
{/* ... */}
/>const onEventMoved = (args) => {
console.log("Moved: " + args.e.text());
};Vue
<DayPilotCalendar
@eventMoved="onEventMoved"
<!-- ... -->
/>const onEventMoved = (args) => {
console.log("Moved: " + args.e.text());
};Event Moving [doc.daypilot.org]
DayPilot.Calendar.eventMoveHandling
Availability of this API item in DayPilot editions:
| Lite | Pro | |
|---|---|---|
| DayPilot for JavaScript |
Lite args missing: areaData, async, external