Skip to main content

move-card

Description

Triggered when a card is moved

Usage

"move-card": ({
id: string | number,
columnId: string | number,
rowId?: string | number,
before?: string | number,
skipProvider?: boolean
}) => void;

Parameters

The callback for the move-card event receives an object with the following properties:

  • id - (required) the ID of the card that is being moved
  • columnId - (required) the ID of the column where the card will be placed
  • rowId - (optional) the ID of the row where the card will be placed
  • before - (optional) the ID of the card before which the moved card will be inserted
  • skipProvider - (optional) controls whether the request to the server should be prevented
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 "move-card" event
board.api.on("move-card", (obj) => {
console.log(obj.columnId);
});

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