drag-card
Description
This event triggers whenever a card is moved using drag-and-drop.
Usage
"drag-card": ({
id: string | number,
columnId: string | number,
rowId?: string | number,
before?: string | number,
source: array
}) => void;
Parameters
The callback for the 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 locatedbefore
- (optional) the ID of the card that appears immediately after the dragged card in the columnsource
- (optional) an array containing the IDs of the cards that were moved
info
To manage internal events, you can use the Event Bus methods
Example
// create Kanban
const board = new kanban.Kanban("#root", {
columns,
cards
});
// subscribe on the "drag-card" event
board.api.on("drag-card", (obj) => {
console.log(obj.columnId);
});
Change log: This event has been available since version 1.4
Related sample: Kanban. Disabling drag and drop to specific columns