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) the unique identifier for the new commentcardId
- (required) the identifier of the card where the comment will be addedcomment
- (required) an object defining the new comment. The available fields include:text
- (optional) the content of the comment in plain textdate
- (optional) the timestamp for the commenthtml
- (optional) the comment formatted in HTML. To show HTML content instead of plain text, thehtml
option in theeditorShape
configuration must be enabled
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