Skip to main content

updateComment()

Description

Modify a card comment by its ID

Usage

updateComment({
id?: string | number,
cardId: string | number,
comment: {
id?: string | number,
cardId?: string | number,
text?: string,
date?: Date,
html?: string
}
}): void;

Parameters

  • id - (optional) the ID of the comment that needs to be updated
  • cardId - (required) the ID of the card containing the comment to update
  • comment - (required) an object defining the updated comment details. This can include:
    • id - (optional) the ID of the comment being updated
    • cardId - (optional) the ID of the card where the updated comment will be placed
    • text - (optional) the new text content of the comment
    • date - (optional) the date associated with the updated comment
    • html - (optional) the HTML content for the updated comment. To show HTML instead of plain text, make sure the html property is enabled in the editorShape configuration

Example

// create Kanban
const board = new kanban.Kanban("#root", {
columns,
cards
});
// update comment
board.updateComment({
id: 1,
cardId: 1,
comment: {
id: 2,
cardId: 4,
text: "",
date: new Date("01/08/2021"),
html: "<b>Updated comment</b>"
}
});

Change log: This method was introduced in version 1.4