Skip to main content

add-card

Description

Fires when adding a new card

Usage

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

Parameters

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

  • columnId - (required) the ID of the target column
  • id - (optional) the ID of the new card
  • rowId - (optional) the ID of the target row
  • before - (optional) the ID of the card, before which the new card will be placed
  • select - (optional) enables/disables selecting new added card
  • card - (optional) the data object of the new card. The full list of the card parameters can be found here
  • skipProvider - (optional) enables/disables preventing the request from being sent to the server
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 "add-card" event
board.api.on("add-card", (obj) => {
console.log(obj.columnId);
});