Skip to main content

updateCard()

Description

Updates the card data by its ID

Usage

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

Parameters

  • id - (required) the ID of the card to be updated

  • card - (optional) the new data object of the card. The full list of the card parameters can be found here

  • replace - (optional) enables/disables fully data replacing

    note

    If you set the replace parameter to true, the old data will be fully replaced by the new ones. Otherwise, the method will update only the values you passed.

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