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;
};
| Field | Type | Description |
|---|---|---|
id | string | number | The 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}
{columns}
ondeletecolumn={ev => console.log("Column deleted:", ev.id)}
/>
Related
- Columns guide - column setup, layout, and runtime updates
- add-column - insert a new column
- move-column - reorder columns
- update-column - patch a column config