addCard()
Description
Inserts a new card into the Kanban board
Usage
addCard({
columnId: string | number,
id?: string | number,
rowId?: string | number,
before?: string | number,
select?: boolean,
card?: object
}): void;
Parameters
columnId- (required) the ID of the column where the card will be addedid- (optional) the ID to assign to the new cardrowId- (optional) the ID of the row where the card should be placedbefore- (optional) the ID of an existing card that the new card will be inserted beforeselect- (optional) whether the newly added card should be selectedcard- (optional) the data object defining the new card
info
You can find the complete list of card parameters 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
The ID of the new card can also be specified inside the card object