DayPilot.Scheduler.onEventMove

This onEventMove event is fired after the user finishes event moving (on drop) but before the default action (eventMoveHandling) is performed.

Declaration

onEventMove(args)

Parameters

  • args.async - activates asynchronous processing of the default action (boolean) - requires calling args.loaded()
  • args.e - event object (DayPilot.Event)
  • args.loaded() - continues processing when args.async is activated
  • args.newStart - target position start (DayPilot.Date)
  • args.newEnd - target position end (DayPilot.Date)
  • args.newResource - target resources id (number | string)
  • args.external - external source status (boolean)
  • args.ctrl - ctrl key pressed status (boolean)
  • args.shift - shift key pressed status (boolean)
  • args.meta - meta key pressed status (boolean)
  • args.position - see event position
  • args.preventDefault() - cancels the default action

Example

dp.onEventMove = function (args) {
  if (args.external) {
    args.preventDefault();
    dp.message("External drop forbidden");
  }
};

api=1

In api=1 mode this event is only called if eventMoveHandling is set to "JavaScript".

Declaration

onEventMove(e, newStart, newEnd, newResource, external, ctrl, shift)

Parameters

  • e (DayPilot.Event) - the event reference
  • newStart (DayPilot.Date) - new event start
  • newEnd (DayPilot.Date) - new event end
  • newResource (string) - id of the new resource
  • external (boolean) - true if this was a move from an external source (outside of the Scheduler)
  • ctrl (boolean) - true if control key was pressed on drop
  • shift (boolean) - true if shift key was pressed on drop