update-column
Patches an existing column with the provided partial. The store merges the new fields into the existing column config by id. If no column matches the given id, the action is silently ignored.
Usage
type UpdateColumnPayload = {
id: ColumnID;
column: Partial<ColumnConfig>;
};
| Field | Type | Description |
|---|---|---|
id | string | number | The column to update |
column | Partial<ColumnConfig> | Fields to merge (label, css, cardLimit, collapsed, etc.) |
Trigger
api.exec("update-column", {
id: "doing",
column: { label: "Work in Progress", cardLimit: 5 },
});
Observe
api.on("update-column", ev => {
console.log("Column updated:", ev.id, ev.column);
});
Intercept
api.intercept("update-column", ev => {
// prevent collapsing a specific column
if (ev.id === "doing" && ev.column.collapsed) return false;
});
Component handler
<Kanban
cards={cards}
columns={columns}
onUpdateColumn={(ev) => console.log("Column changed:", ev.id)}
/>
Related
- Columns guide - column setup, layout, and runtime updates
- columns - column definitions in board order