The onTaskMoving event handler fires repeatedly during drag and drop task box moving in the Gantt Chart, whenever the position changes.
Declaration
DayPilot.Gantt.onTaskMoving(args)Parameters
args.allowed(boolean) - determines whether the task can be dropped at the current location. Read/write.args.control(DayPilot.Gantt) - component reference.args.ctrl(boolean) -trueif the Ctrl key is pressed. Read-only.args.shift(boolean) -trueif the Shift key is pressed. Read-only.args.meta(boolean) -trueif the Meta key is pressed. Read-only.args.alt(boolean) -trueif the Alt key is pressed. Read-only.args.cssClass(string) - CSS class added to the moving shadow. Read/write.args.duration(DayPilot.Duration) - task duration.args.html(string) - inner HTML of the shadow object.args.multimove- array of all tasks being moved during multi-moving, including their new positions.args.task- DayPilot.Task object representing the task. Read-only.args.start(DayPilot.Date) - current start position. Read/write.args.end(DayPilot.Date) - current end position. Read/write.args.left.html(string) - HTML of the start indicator. Read/write.args.left.enabled(boolean) - whether the start indicator should be displayed. Read/write.args.right.html(string) - HTML of the end indicator. Read/write.args.right.enabled(boolean) - whether the end indicator should be displayed. Read/write.
Examples
JavaScript
const gantt = new DayPilot.Gantt("dp", {
taskMoveHandling: "Update",
onTaskMoving: (args) => {
args.left.html = args.start.toString("d MMMM yyyy");
},
// ...
});
gantt.init();Angular
<daypilot-gantt [config]="config"></daypilot-gantt>config: DayPilot.GanttConfig = {
taskMoveHandling: "Update",
onTaskMoving: args => {
args.left.html = args.start.toString("d MMMM yyyy");
},
// ...
};React
<DayPilotGantt
taskMoveHandling="Update"
onTaskMoving={onTaskMoving}
{/* ... */}
/>const onTaskMoving = (args) => {
args.left.html = args.start.toString("d MMMM yyyy");
};Vue
<DayPilotGantt
taskMoveHandling="Update"
@taskMoving="onTaskMoving"
<!-- ... -->
/>const onTaskMoving = (args) => {
args.left.html = args.start.toString("d MMMM yyyy");
};See Also
Availability
Availability of this API item in DayPilot editions:
| Product | Lite | Pro |
|---|---|---|
| DayPilot for JavaScript |
DayPilot