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 identifier for the new cardrowId
- (optional) the ID of the row where the card should be placedbefore
- (optional) the ID of the card before which the new card will be insertedselect
- (optional) determines whether the new card will be selected upon additioncard
- (optional) the data object representing the new card
info
A complete list of card parameters is available 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
It's also possible to include the card ID inside the card object