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.
Declaration
DayPilot.Calendar.onEventMoved(args)Parameters
args.e(DayPilot.Event) - moved calendar eventargs.newStart(DayPilot.Date) - new event start date/timeargs.newEnd(DayPilot.Date) - new event end date/timeargs.newResource(string | number) - new resource ID in Resources viewargs.external(boolean) -truewhen the event was dragged from an external source; available for the DayPilot Pro external drag and drop scenarioargs.ctrl(boolean) - Ctrl key statusargs.shift(boolean) - Shift key status
Notes
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.
Examples
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());
};See Also
Event Moving [doc.daypilot.org]
DayPilot.Calendar.eventMoveHandling
Availability
Availability of this API item in DayPilot editions:
| Product | Lite | Pro |
|---|---|---|
| DayPilot for JavaScript |
Lite args missing: areaData, async, external
DayPilot