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().
DayPilot.Gantt.onTaskMove(args)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.
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();
}
};