Skip to main content

drag-card

Description

Fires when moving the card via dnd

Usage

"drag-card": ({
id: string | number,
columnId: string | number,
rowId?: string | number,
before?: string | number,
source: array
}) => void;

Parameters

The callback of the drag-card event can take an object with the following parameters:

  • id - (required) the ID of the dragged card
  • columnId - (required) the ID of the column where the card currently is
  • rowId - (optional) the ID of the row where the card currently is
  • before - (optional) the ID of a card that is currently after the dragged card in the column
  • source - (optional) the array of moved cards' IDs
info

For handling the inner 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: The event was added in v1.4

Related sample: Kanban. Disabling drag and drop to specific columns