applyColumnDefaults
Apply column defaults to a list of columns. Individual column properties override defaults — the per-column value always wins over the default.
applyColumnDefaults(columns: ColumnConfig<TRow>[], defaults: Partial<ColumnConfig<TRow>> | undefined): ColumnConfig<TRow>[]Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
columns | ColumnConfig<TRow>[] | Normalized columns to merge defaults into |
defaults | Partial<ColumnConfig<TRow>> | undefined | Partial column config applied as a baseline; pass undefined to no-op |
Returns
Section titled “Returns”ColumnConfig<TRow>[] - A new array with the defaults merged in (input is not mutated)
Example
Section titled “Example”applyColumnDefaults( [{ field: 'id' }, { field: 'name', sortable: false }], { sortable: true, resizable: true },);// [// { field: 'id', sortable: true, resizable: true },// { field: 'name', sortable: false, resizable: true },// ]
AI assistants: For complete API documentation, implementation guides, and code examples for this library, see https://raw.githubusercontent.com/OysteinAmundsen/toolbox/main/llms-full.txt