The onTaskResize event handler fires when the user finishes drag and drop task box resizing in the Gantt Chart, before the default action specified by taskResizeHandling.
The default action can be canceled by calling args.preventDefault().
Declaration
DayPilot.Gantt.onTaskResize(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.preventDefault()- cancels the default action.
Examples
JavaScript
const gantt = new DayPilot.Gantt("dp", {
taskResizeHandling: "Update",
onTaskResize: (args) => {
DayPilot.Modal.alert("Resizing: " + args.task.text());
},
// ...
});
gantt.init();Angular
<daypilot-gantt [config]="config"></daypilot-gantt>config: DayPilot.GanttConfig = {
taskResizeHandling: "Update",
onTaskResize: args => {
DayPilot.Modal.alert("Resizing: " + args.task.text());
},
// ...
};React
<DayPilotGantt
taskResizeHandling="Update"
onTaskResize={onTaskResize}
{/* ... */}
/>const onTaskResize = (args) => {
DayPilot.Modal.alert("Resizing: " + args.task.text());
};Vue
<DayPilotGantt
taskResizeHandling="Update"
@taskResize="onTaskResize"
<!-- ... -->
/>const onTaskResize = (args) => {
DayPilot.Modal.alert("Resizing: " + args.task.text());
};See Also
Availability
Availability of this API item in DayPilot editions:
| Product | Lite | Pro |
|---|---|---|
| DayPilot for JavaScript |
DayPilot