API reference: @salmonui/data-grid
DataGridColumnInfointerface
import type { DataGridColumnInfo } from '@salmonui/data-grid';interface DataGridColumnInfo<Row = unknown> {
readonly id: string;
readonly field: string | null;
readonly header: string;
readonly type: ColumnType;
readonly format: string | FormatOptions | undefined;
readonly align: 'start' | 'center' | 'end' | 'justify' | undefined;
readonly headerAlign: 'start' | 'center' | 'end' | undefined;
readonly width: ColumnWidth;
readonly minWidth: number;
readonly maxWidth: number;
readonly pinned: 'start' | 'end' | 'center' | null;
readonly hidden: boolean;
readonly sortable: boolean;
readonly filterable: boolean;
readonly searchable: boolean;
readonly groupable: boolean;
readonly editable: boolean;
readonly resizable: boolean;
readonly reorderable: boolean;
readonly hideable: boolean;
readonly primaryKey: boolean;
readonly lockPosition: boolean;
readonly displayAsCheckbox: boolean;
readonly leaf: boolean;
readonly depth: number;
readonly path: readonly string[];
readonly children: readonly string[];
readonly definition: Readonly<Record<string, unknown>>;
getValue(row: Row): unknown;
formatValue(value: unknown, row: Row): string;
}
Read-only public view of a compiled column, as render props and events
receive it. Field names follow the name table; flags carry their resolved
defaults. Values are the definition's (runtime visibility, width, order,
and pin state are in api.getState() and the column events).
| Name | Signature | Description |
|---|---|---|
id | readonly id: string; | The column key: |
field | readonly field: string | null; | The data field (dot path), or null for columns without one. |
header | readonly header: string; | |
type | readonly type: ColumnType; | |
format | readonly format: string | FormatOptions | undefined; | |
align | readonly align: 'start' | 'center' | 'end' | 'justify' | undefined; | |
headerAlign | readonly headerAlign: 'start' | 'center' | 'end' | undefined; | |
width | readonly width: ColumnWidth; | |
minWidth | readonly minWidth: number; | |
maxWidth | readonly maxWidth: number; |
|
pinned | readonly pinned: 'start' | 'end' | 'center' | null; | Definition pin side. |
hidden | readonly hidden: boolean; | Definition visibility. |
sortable | readonly sortable: boolean; | |
filterable | readonly filterable: boolean; | |
searchable | readonly searchable: boolean; | |
groupable | readonly groupable: boolean; | |
editable | readonly editable: boolean; | |
resizable | readonly resizable: boolean; | |
reorderable | readonly reorderable: boolean; | |
hideable | readonly hideable: boolean; | Listed in the column chooser. |
primaryKey | readonly primaryKey: boolean; | |
lockPosition | readonly lockPosition: boolean; | |
displayAsCheckbox | readonly displayAsCheckbox: boolean; | |
leaf | readonly leaf: boolean; | False for stacked header groups. |
depth | readonly depth: number; | Header depth (0 for top level). |
path | readonly path: readonly string[]; | Stacked header group ids, root first, ending with this column. |
children | readonly children: readonly string[]; | Child column ids of a stacked header group. |
definition | readonly definition: Readonly<Record<string, unknown>>; | The column definition as given ( |
getValue | getValue(row: Row): unknown; | The column value of a row ( |
formatValue | formatValue(value: unknown, row: Row): string; | The display text of a value ( |