addCard()
Description
Adds a new card into Kanban
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 target columnid
- (optional) the ID of the new cardrowId
- (optional) the ID of the target rowbefore
- (optional) the ID of the card, before which the new card will be placedselect
- (optional) enables/disables selecting new added cardcard
- (optional) the data object of the new card
info
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