fires before a drag operation in the Gantt chart is started
task | object | task object |
context | object | an object with drag context |
boolean | returning false will prevent any drag operation in the chart |
$$("gantt1").attachEvent("onBeforeDrag", function(task, context) {
const name = item.text || "(no title)";
const mode = context.mode;
if (mode == "move") {
webix.message("'" + name + "' is being moved");
}
// ...
});
The context object includes the mode field that stores the drag mode with the following values possible:
Returning false from the event handler will block any drag operation with tasks on the chart (link creation, changing task progress, etc).
$$("gantt1").attachEvent("onBeforeDrag", function(task, context) {
return false;
});
Note the event only fires for chart tasks and is not triggered when tree items are being dragged.