fires after the user has pressed the mouse button and started dragging, but before dhtmlxGantt starts the drag-and-drop operation

boolean onBeforeTaskDrag(string|number id,string mode,Event e);
idstring|numberthe task id
modestringthe drag-and-drop mode ("resize", "progress", "move", "ignore")
eEventa native event object
booleandefines whether the default action of the event will be triggered (true) or canceled (false)


gantt.attachEvent("onBeforeTaskDrag", function(id, mode, e){
    //any custom logic here
    return true;

Related samples


The event fires when the user drags a task in the timeline area.

The event is blockable. Return false and the task will be backed to the initial position.

See also
Back to top