Skip to main content

updateCard()

Description

Modifies the card data using its ID

Usage

updateCard({
id: string | number,
card?: object,
replace?: boolean
}): void;

Parameters

  • id - (required) the ID of the card to update

  • card - (optional) the new data object for the card. You can find the complete list of card parameters here

  • replace - (optional) controls whether to completely replace the existing data

    note

    Setting the replace parameter to true will overwrite the old data entirely with the new one. If not set or false, only the provided fields 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 added in v1.1
  • The replace parameter was added in v1.3