Skip to main content

delete-column

Removes the column config with the given id. Only the column entry goes away. Cards in that column stay in the data but aren't rendered, since the board shows no cards for unknown column ids. If no column matches id, the action does nothing.

The action resets the undo/redo history when history is enabled.

Usage​

type DeleteColumnPayload = {
id: ColumnID;
};
FieldTypeDescription
idstring | numberThe column to remove

Trigger​

api.exec("delete-column", { id: "archive" });

Observe​

api.on("delete-column", ev => {
console.log("Column removed:", ev.id);
});

Intercept​

api.intercept("delete-column", ev => {
// keep columns that still have cards
const hasCards = api.getCards().some(card => card.column === ev.id);
if (hasCards) return false;
});

Component handler​

The ondeletecolumn prop receives this action.

<Kanban
:cards="cards"
:columns="columns"
:ondeletecolumn="(ev) => console.log('Column deleted:', ev.id)"
/>