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) -trueif the Ctrl key is pressed.args.shift(boolean) -trueif 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
Availability
Availability of this API item in DayPilot editions:
| Product | Lite | Pro |
|---|---|---|
| DayPilot for JavaScript |
DayPilot