Skip to main content

addCard()

Description

adds a new card into Kanban

Usage

addCard({
columnId: string | number,
id?: string | number,
rowId?: string | number,
before?: string | number,
card?: object
}): void;

Parameters

  • columnId - (mandatory) 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
  • card - (optional) the data object of the new card.
tip

The full list of the card parameters can be found here

Example

// create Kanban
const board = new kanban.Kanban("#root", {
columns,
cards
});
// add new card into the "backlog" column
board.addCard({
id: 1,
columnId: "backlog",
card: { label: "New card" }
});
tip

You can also specify the ID of the new card in the card object