addComment()
Description
Inserts a new comment into the specified card using its ID
Usage
addComment({
id?: string | number,
cardId: string | number,
comment: {
text?: string,
date?: Date,
html?: string
}
}): void;
Parameters
id- (optional) identifier for the new commentcardId- (required) identifier of the card where the comment will be addedcomment- (required) object defining the new comment's details. It can include:text- (optional) the comment's text contentdate- (optional) the date associated with the commenthtml- (optional) HTML content for the comment. To display HTML instead of plain text, enable thehtmlproperty in theeditorShapeconfiguration
Example
// create Kanban
const board = new kanban.Kanban("#root", {
columns,
cards
});
// add new comment
board.addComment({
id: 1,
cardId: 1,
comment: {
text: "",
date: new Date("01/07/2021"),
html: "<b>Important comment</b>"
}
});
Change log: This method was introduced in version 1.4