Skip to main content

api.on()

Description

Allows attaching a handler to the inner events

Usage

api.on(
event: string,
handler: function
): void;

Parameters

  • event - (required) an event to be fired
  • handler - (required) a handler to be attached (the handler arguments will depend on the event to be fired)

Events

info

The full list of the Kanban internal events can be found here

Example

// create Kanban
const board = new kanban.Kanban("#root", {
columns,
cards
});
// output the card data in console when its moving
board.api.on("move-card", ({ id, columnId }) => {
console.log({ id, columnId });
});