The onTaskMoved event handler fires when the user finishes drag and drop task box moving in the Gantt Chart, after the default action specified by taskMoveHandling.
Declaration
DayPilot.Gantt.onTaskMoved(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.
Examples
JavaScript
const gantt = new DayPilot.Gantt("dp", {
taskMoveHandling: "Update",
onTaskMoved: (args) => {
DayPilot.Modal.alert("Moved to: " + args.newStart.toString());
},
// ...
});
gantt.init();Angular
<daypilot-gantt [config]="config"></daypilot-gantt>config: DayPilot.GanttConfig = {
taskMoveHandling: "Update",
onTaskMoved: args => {
DayPilot.Modal.alert("Moved to: " + args.newStart.toString());
},
// ...
};React
<DayPilotGantt
taskMoveHandling="Update"
onTaskMoved={onTaskMoved}
{/* ... */}
/>const onTaskMoved = (args) => {
DayPilot.Modal.alert("Moved to: " + args.newStart.toString());
};Vue
<DayPilotGantt
taskMoveHandling="Update"
@taskMoved="onTaskMoved"
<!-- ... -->
/>const onTaskMoved = (args) => {
DayPilot.Modal.alert("Moved to: " + args.newStart.toString());
};See Also
Availability
Availability of this API item in DayPilot editions:
| Product | Lite | Pro |
|---|---|---|
| DayPilot for JavaScript |
DayPilot