onTaskDrag
fires when the user drags a task
void onTaskDrag(string|number id,string mode,Task task,Task original,Event e);
id | string|number | the task id |
mode | string | the drag mode ("resize", "progress", "move", "ignore") |
task | Task | the current (dragged) task object |
original | Task | the original(initial) task object |
e | Event | a native event object |
Example
gantt.attachEvent("onTaskDrag", function(id, mode, task, original){
//any custom logic here
});
Related samples
Details
The event:
- Fires each time the user makes a drag movement with the mouse in the timeline area: moves, resizes a task or changes the task's progress.
- The type of a drag movement is passed as the 2nd argument - mode.
- All available values of the drag movement's type are stored in the drag_mode property.
Shortly, all happens in the following order:
- The user makes a move.
- dhtmlxGantt recalculates the task's date according to the new position.
- dhtmlxGantt fires the onTaskDrag event.
- dhtmlxGantt re-renders the task in the Gantt chart.
See also
Back to top