start-drag
Description
Fires when the user starts to drag the tasks
Usage
"start-drag":({
start: string | number,
mode: "move" | "copy"
}) => void;
Parameters
The callback of the start-drag event can take an object with the following parameters:
start
- (required) the ID of the task from which the dragging process has startedmode
- (required) the mode of drag-n-drop:move
- the move modecopy
- the copy mode
info
To handle the inner events, you can use the Event Bus methods
Example
const { ToDo, Toolbar } = todo;
const {tasks, projects, users} = getData();
const list = new ToDo("#root", {
tasks,
projects,
users
});
const toolbar = new Toolbar("#toolbar", {
api: list.api,
});
// subscribe to the "start-drag" event
list.api.on("start-drag", ({ start, mode }) => {
console.log(start, mode);
});
Change log: Added in v1.1
Related article: Drag-n-drop