DayPilot.Scheduler.onEventMove

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

See also onEventMoved event which is fired after the default action.

Declaration

DayPilot.Scheduler.onEventMove(args);

Parameters

  • args.areaData - value of the data property of the active area that was used as drag handle

  • args.control - DayPilot.Scheduler instance

  • 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.multimove - an array of all events being moved during multi-moving (and their new positions)

  • 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

Moving multiple events

The args.multimove array items have the following structure:

  • args.multimove[].eventDayPilot.Event object

  • args.multimove[].start - new start (DayPilot.Date)

  • args.multimove[].end - new end (DayPilot.Date)

  • args.multimove[].resource - new resource (string | number)

  • args.multimove[].overlapping - overlapping status (boolean, read-only)

The args.multimove array includes the main event as well (args.e).

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