fires before a task is moved to a new vertical position
id | string|number | the id of the task to move |
parent | string|number | the parent id |
tindex | number | the index of the position in the parent branch that the task will be moved to |
boolean | defines whether the default action of the event will be triggered (true) or canceled (false) |
//prevent moving to another sub-branch:
gantt.attachEvent("onBeforeTaskMove", function(id, parent, tindex){
const task = gantt.getTask(id);
if(task.parent != parent)
return false;
return true;
});
The event is blockable. Return false to cancel moving of the task.
Note, the event fires in 2 cases: