Column definitions
Columns are plain objects. The column id is id if you set one, otherwise field; sorting, filters and column state all refer to columns by that id.
Columns are plain objects. The column id is id if you set one, otherwise field; sorting, filters and column state all refer to columns by that id.
const columns = [
{ field: 'id', header: 'ID', type: 'number', format: '0', width: 80, pinned: 'left' },
{ field: 'name', header: 'Name', flex: 1, minWidth: 160 },
{ field: 'price', header: 'Price', type: 'number', format: 'currency:KRW' },
{ field: 'qty', header: 'Qty', type: 'number' },
// computed column
{ id: 'amount', header: 'Amount', type: 'number', format: '#,##0', valueGetter: row => row.price * row.qty },
{ field: 'status', header: 'Status', filter: 'set', cellClass: p => `status-${p.value}` },
];| Name | Type | Description |
|---|---|---|
field | string | Property of the row object shown in this column; 'address.city' reads and writes nested objects. |
id | string | Column id. Defaults to field; required when there is no field. |
header | string | Header text. Defaults to field. |
type | 'text' | 'number' | 'date' | 'boolean' | Drives alignment, formatting, sorting and the default filter. |
format | string | Intl options | Number: '#,##0.00', '0.0%', 'currency:KRW', 'integer'. Date: 'date', 'datetime', 'time', 'short', 'medium', 'long'. |
width / minWidth / maxWidth | number | Pixel widths. Default width 120, min 40. |
flex | number | Share of the leftover width. Resizing turns it into a fixed width. |
pinned | 'left' | 'right' | Keep the column visible while scrolling horizontally. |
hide | boolean | Start hidden. Users can show it from the column chooser. |
align | 'left' | 'center' | 'right' | Cell alignment. Numbers default to right. |
sortable | boolean | Default true. |
resizable | boolean | Default true. |
filter | 'text' | 'number' | 'date' | 'set' | false | Filter UI in the column menu. Default depends on type. |
comparator | (a, b, rowA, rowB) => number | Custom sort order. |
valueFormatter | ({ value, formatted, row?, column }) => string | Text of the value on screen, in quick search, find, tooltips, copy, CSV, print and PDF (Excel keeps numbers and dates). formatted is what format would show. |
valueParser | ({ text, row, oldValue, column }) => unknown | Typed or pasted text → the value to store; undefined refuses it. Rules still run. |
autoSize | boolean | false: the autoSizeColumns option leaves this column alone. |
valueGetter | (row) => unknown | Computed value, e.g. quantity × price. Used for display, sort, filter and summaries. |
renderer | (params) => string | HTMLElement | Custom cell content. Strings are inserted as HTML — escape untrusted data. |
cellClass | string | (params) => string | Extra CSS class on cells. Its text color, background and bold also go into Excel exports. |
wrapText | boolean | Wrap long text onto more lines; with autoRowHeight the row grows to fit. |
rowSpan / colSpanPaid · rowSpan | ({ value, row, rowIndex }) => number | Cells covering several rows or columns, decided per cell. rowSpan takes precedence over merge. |
headerRenderer | ({ header, column }) => string | HTMLElement | Header content (icons, buttons, links); sorting and the menu button stay. |
headerClass | string | (column) => string | Extra class names on the header cell (also for column groups). |
copyable | boolean | ({ value, row, column }) => boolean | false keeps values out of copies: blocked cells copy as empty text. |
tooltip / headerTooltip | boolean | (params) => string / string | Hover text: true shows the value, a function returns the text; headerTooltip explains the header. Cut-off text shows in full anyway (overflowTooltip). |
columnGroupShow / openByDefault | 'open' | 'closed' / boolean | Collapsible column groups: show a child only while its group is open or closed; the group header gets a toggle. |
sparkline | true | { type?: 'line' | 'bar' | 'area', color? } | The value is an array of numbers drawn as a small chart in the cell. |
children | ColumnDef[] | Makes this a column group header. |
mergePaid | boolean | (a, b, rowA, rowB) => boolean | Merge consecutive rows with the same value into one tall cell. |
mergeAlignPaid | 'top' | 'middle' | 'bottom' | Where the text of a merged cell sits (default 'top'); it stays in the part of the block in view while scrolling. |
wrapHeaderText | boolean | Let a long header label wrap. |
aggFuncPaid | 'sum' | 'avg' | 'min' | 'max' | 'count' | (values, rows) => value | Aggregate shown in group rows. |
chooser | boolean | false keeps the column out of the column chooser. |
lockVisible | boolean | Users cannot hide this column. |
editable | boolean | ({ value, row, rowIndex, column }) => boolean | Allow editing and pasting (needs field); a function decides per cell. |
sortAbsolute / valuesAs | boolean / 'percentOfTotal' | 'percentOfParent' | 'runningTotal' | Sort numbers by size; show numbers as a share or a running total (screen only). |
button | { label?, onClick(params), disabled?(params) } | A button in every cell; the click does not select the row or start an edit. |
link | { href?: string | (params) => string, target?, label?, onClick? } | The value as a link; href is a function or a template like '/orders/{id}'. |
image | { width?, height?, round?, alt? } | The value is an image URL drawn as a thumbnail. |
headerCheckbox | boolean | Boolean and switch columns: a header checkbox that turns every shown editable cell on or off. |
dependsOn | string[] | Fields the options come from; a value no longer offered is cleared when one changes (same undo step). |
editor | { type: 'select' | 'combo' | 'multiSelect' | 'radio', options } | { type: 'date' | 'dateRange', min?, max?, disabledDates? } | { type: 'toggle', on?, off? } | { type: 'number', min?, max?, step? } | { type: 'mask', mask, raw? } | { type: 'modal' | 'textarea' | 'time' | 'datetime' } | (params) => editor | Editor for this column; see Editing › Editors. Date columns open a calendar by default, and format 'datetime' a date-time picker. options can be a function of the row (dependent selects); a combo function gets the typed text and may return a Promise. An option with disabled: true cannot be chosen or pasted. mask: 'phone', 'bizNo', 'card', 'zip' or a pattern like '000-0000-0000'. |
singleClickEdit | boolean | Open the editor with one click instead of a double-click. |
required | boolean | Reject blank values. |
validate | (value, row) => true | string | Return a message to reject a value. |
unique | boolean | Reject a value another row already has in this column (blank values are allowed). |
formulasPaid | boolean | Cells may hold formulas like '=qty*price' (same-row fields, + - * / % ^ &, ROUND, ABS, MIN, MAX, SUM, AVG, IF). The result is shown, sorted and exported; the editor keeps the formula. |