start-drag-card
Description
Triggered when a card begins to be dragged
Usage
"start-drag-card": ({
id: string | number,
columnId: string | number,
rowId?: string | number,
before?: string | number,
source?: array
}) => void;
Parameters
The callback for the start-drag-card event receives an object with the following properties:
id
- (required) the ID of the card being draggedcolumnId
- (required) the ID of the column where the card is currently locatedrowId
- (optional) the ID of the row where the card is currently positionedbefore
- (optional) the ID of the card that follows the dragged card in the columnsource
- (optional) an array containing the IDs of the cards being moved
info
To work with internal events, the Event Bus methods can be used.
Example
// create Kanban
const board = new kanban.Kanban("#root", {
columns,
cards
});
// subscribe on the "start-drag-card" event
board.api.on("start-drag-card", (obj) => {
console.log(obj.columnId);
});
Change log: This event was introduced in version 1.4
Related sample: Kanban. Disabling drag and drop to specific columns