add-comment
Description
Triggered when a new comment is added
Usage
"add-comment": ({
id?: string | number,
cardId: string | number,
comment: {
text?: string,
date?: Date,
html?: string
},
skipProvider?: boolean
}) => void;
Parameters
The callback for the add-comment event receives an object with these properties:
id
- (optional) the ID assigned to the new commentcardId
- (required) the ID of the card where the comment is being addedcomment
- (required) an object defining the new comment details. It can include:text
- (optional) the comment's text contentdate
- (optional) the date when the comment was madehtml
- (optional) the comment's HTML content. To enable rendering of HTML instead of text, activate thehtml
property in theeditorShape
configuration
skipProvider
- (optional) controls whether the request to the server is prevented or not
info
To manage internal event handling, refer to the Event Bus methods
Example
// create Kanban
const board = new kanban.Kanban("#root", {
columns,
cards
});
// listen to the "add-comment" event
board.api.on("add-comment", (obj) => {
console.log(obj.comment);
});
Change log: This event was introduced in v1.4