updateCard()
Description
Updates a card's data by its ID
Usage
updateCard({
id: string | number,
card?: object,
replace?: boolean
}): void;
Parameters
id
- (required) the ID of the card to be updatedcard
- (optional) an object containing the updated data for the card. A full list of card parameters is available herereplace
- (optional) controls whether the existing data is fully replaced
note
Setting replace
to true will completely overwrite the old data with the new data. Otherwise, only the properties you provide will be updated.
Example
// create Kanban
const board = new kanban.Kanban("#root", {
columns,
cards
});
// update card data with the 1 ID
board.updateCard({
id: 1,
card: {
label: "New Label",
row: "feature",
column: "inprogress",
/*other parameters*/
},
replace: true
});
Change log:
- The id and card parameters were introduced in v1.1
- The replace parameter was added in v1.3