activates the 'branch' mode that allows vertically reordering tasks within the same tree level
gantt.config.order_branch = true;
gantt.init("gantt_here");
This option allows reordering tasks, while saving their tree level position. For example, a subtask will never become the parent task.
If your Gantt contains lots of tasks, the default mode of branch reordering may slow down the performance. To speed it up, you can make use of the "marker" mode.
gantt.config.order_branch = "marker";
Related sample: Branch ordering - highlighting mode
In this mode only the name of the task is reordered (on holding the left mouse key) and Gantt is re-rendered only when a task is dropped in the target position (on releasing the key). Unlike the default mode, changing of the task position doesn't involve firing of the onBeforeTaskMove/onAfterTaskMove events.
To prevent dropping of a task in a particular position, use the onBeforeRowDragMove event instead (works only in the "marker" mode).