The onEventMoved event handler fires after the user drops an event at the target location in the monthly calendar during drag and drop event moving.
This event is called after the default action set using DayPilot.Month.eventMoveHandling. When this handler runs, the event is already moved to the target location in the UI.
See also DayPilot.Month.onEventMove, which fires before the default action.
Declaration
DayPilot.Month.onEventMoved(args)Parameters
args.e(DayPilot.Event) - the event being movedargs.newStart(DayPilot.Date) - the new event startargs.newEnd(DayPilot.Date) - the new event endargs.ctrl(boolean) - state of theCtrlkey on dropargs.meta(boolean) - state of theMetakey on drop (available since 2023.3.5604)args.shift(boolean) - state of theShiftkey on dropargs.position(number) - target vertical position of the event within a cell in the cell stacking mode
Examples
JavaScript
const dp = new DayPilot.Month("dp", {
onEventMoved: (args) => {
console.log("Moved:", args.e.text(), args.newStart, args.newEnd);
},
// ...
});
dp.init();Angular
<daypilot-month [config]="config"></daypilot-month>config: DayPilot.MonthConfig = {
onEventMoved: (args) => {
console.log("Moved:", args.e.text(), args.newStart, args.newEnd);
},
// ...
};React
<DayPilotMonth
onEventMoved={onEventMoved}
{/* ... */}
/>const onEventMoved = (args) => {
console.log("Moved:", args.e.text(), args.newStart, args.newEnd);
};Vue
<DayPilotMonth
@eventMoved="onEventMoved"
<!-- ... -->
/>const onEventMoved = (args) => {
console.log("Moved:", args.e.text(), args.newStart, args.newEnd);
};See Also
Event Moving [doc.daypilot.org]
DayPilot.Month.eventMoveHandling
Availability
Availability of this API item in DayPilot editions:
| Product | Lite | Pro |
|---|---|---|
| DayPilot for JavaScript |
Lite args missing: external, position
DayPilot