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 does nothing.
Usage
type UpdateColumnPayload = {
id: ColumnID;
column: Partial<ColumnConfig>;
};
| Field | Type | Description |
|---|---|---|
id | string | number | The column to update |
column | Partial<ColumnConfig> | Fields to merge into the column |
Accepts any ColumnConfig field: label, css, summaries, addCard, menu, metadata, collapsed, width, cardWidth, cardHeight, and custom keys. Pass summaries: [] to clear the column's summaries. Custom keys pass through to the projected column, so callbacks such as columnCss can read them.
Trigger
api.exec("update-column", {
id: "doing",
column: { label: "Work in Progress", width: 320 },
});
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 forwards the action to the onUpdateColumn prop. GroupManager renames columns through update-column, so this handler also fires on its renames.
<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