DayPilot.Gantt.onTaskMove

The onTaskMove event handler fires when the user finishes drag and drop task box moving in the Gantt Chart, before the default action specified by taskMoveHandling.

The default action can be canceled by calling args.preventDefault().

Declaration

DayPilot.Gantt.onTaskMove(args)

Parameters

  • args.task - DayPilot.Task object representing the task.

  • args.newStart (DayPilot.Date) - new task start.

  • args.newEnd (DayPilot.Date) - new task end.

  • args.external (boolean) - indicates an external source of the task.

  • args.ctrl (boolean) - true if the Ctrl key is pressed.

  • args.shift (boolean) - true if the Shift key is pressed.

  • args.preventDefault() - cancels the default action.

Examples

JavaScript

const gantt = new DayPilot.Gantt("dp", {
  taskMoveHandling: "Update",
  onTaskMove: (args) => {
    if (args.external) {
      args.preventDefault();
    }
  },
  // ...
});
gantt.init();

Angular

<daypilot-gantt [config]="config"></daypilot-gantt>
config: DayPilot.GanttConfig = {
  taskMoveHandling: "Update",
  onTaskMove: args => {
    if (args.external) {
      args.preventDefault();
    }
  },
  // ...
};

React

<DayPilotGantt
  taskMoveHandling="Update"
  onTaskMove={onTaskMove}
  {/* ... */}
/>
const onTaskMove = (args) => {
  if (args.external) {
    args.preventDefault();
  }
};

Vue

<DayPilotGantt
  taskMoveHandling="Update"
  @taskMove="onTaskMove"
  <!-- ... -->
/>
const onTaskMove = (args) => {
  if (args.external) {
    args.preventDefault();
  }
};

See Also

DayPilot.Gantt Class

Availability

Availability of this API item in DayPilot editions:

LitePro
DayPilot for JavaScript