api.on()
Description
Enables the attachment of a handler to internal events
Usage
api.on(
event: string,
handler: function
): void;
Parameters
event
- (required) the event to listen forhandler
- (required) the function to handle the event (arguments depend on the triggered event)
Events
info
You can find the complete list of Kanban internal events here
Example
// create Kanban
const board = new kanban.Kanban("#root", {
columns,
cards
});
// log card data to the console when a card is moved
board.api.on("move-card", ({ id, columnId }) => {
console.log({ id, columnId });
});