Skip to main content

api.intercept()

Description

Enables catching and blocking internal events before they happen.

Usage

api.intercept(
event: string,
callback: function
): void;

Parameters

  • event - (required) the event to listen for
  • callback - (required) the function to run (its arguments depend on the event being intercepted)

Events

info

You can check out the complete list of Kanban internal events here

Example

// create Kanban
const board = new kanban.Kanban("#root", {
columns,
cards
});
// prevent cards from being moved to the column with the "done" ID
board.api.intercept("move-card", ({ id, columnId }) => {
if(columnId !== "done" ){
return false;
}
});