Zum Hauptinhalt springen

api.detach()

Beschreibung

Ermöglicht das Entfernen/Abtrennen eines Event-Listeners

Verwendung

api.detach(tag: number | string | symbol ): void;

Parameter

  • tag - das Tag, das zur Identifizierung eines Event-Handlers bei dessen Erstellung verwendet wurde

Beispiel

// Kanban erstellen
const board = new kanban.Kanban("#root", {
columns,
cards
});

board.api.on("move-card", ({ id, columnId }) => {
console.log("Move the card");
}, { tag: "move" });

board.api.detach("move");

Änderungsprotokoll: Die interne Methode wurde in Version v1.7 hinzugefügt