Data Grid for Angular
import { AuiDataGrid } from '@absoluteui/angular/data-grid';Styles are included with the component. Behavior, keyboard and screen-reader support, design tokens, and limitations are described on the Data Grid page; this page covers the Angular API.
Defaults for every instance: provideAbsoluteUIConfig({ components: { dataGrid: { ... } } }) (see Configuration).
Example
Section titled “Example”import { Component, signal } from '@angular/core';import type { DataGridColumnDef, DataGridSort } from '@absoluteui/components/data-grid';import { AuiDataGrid } from '@absoluteui/angular/data-grid';
interface Person { id: string; name: string; city: string;}
@Component({ selector: 'app-people-grid', imports: [AuiDataGrid], template: `<aui-data-grid label="People" [columns]="columns" [rows]="people" [rowId]="byId" [(sort)]="sort" [style.block-size.px]="400" />`,})export class PeopleGridComponent { readonly people: Person[] = [{ id: '1', name: 'Ada', city: 'London' }]; readonly columns: DataGridColumnDef<Person>[] = [ { id: 'name', header: 'Name', field: 'name', pinned: 'start' }, { id: 'city', header: 'City', field: 'city', flex: 1 }, ]; readonly byId = (p: Person): string => p.id; readonly sort = signal<readonly DataGridSort[] | undefined>(undefined);}<aui-data-grid>
Section titled “<aui-data-grid>”Class AuiDataGrid; template reference #ref="auiDataGrid".
Server rendering: Renders on the server; the browser re-creates it after hydration.
Inputs
Section titled “Inputs”| Input | Type | Default | Description |
|---|---|---|---|
label |
string |
Required. Accessible name of the grid. | |
description |
string |
Accessible description of the grid (aria-describedby). | |
columns |
readonly DataGridColumnDef<Row>[] |
Required. Columns and column groups (nested). Column: id, header, accessor or field, type, currency, format, render, align, width, minWidth, maxWidth, flex, resizable, movable, pinned, lockPinned, lockPosition, hidden, sortable, compare, headerTooltip, wrapHeader, wrapText, rowDrag (this column holds the row drag handle; default the first data column), tooltip (true, a text, or (value, row) => text; with the tooltips accessory), spanRows (true or (a, b) => boolean: merge equal adjacent values), colSpan (row => columns covered), cellClass, cellClassRules, flashOnChange, copyValue, exportable, formula (a calculated column with the formulas option: [Column] is the same row, A1 references and functions as in spreadsheets; read-only), formulas (cell formulas: values that are text starting with = are evaluated; editing shows the formula; fill, Ctrl+D, and paste of copied cells move relative A1 references), excel (Excel export: style, cellStyle(row), numberFormat, formula(row, ref), link(row), image(row), width) (false leaves the column out of CSV and Excel exports of visible or all columns), aggregate, showAs, groupable, groupHierarchy, editable, setValue, parseValue, editor, required, validate, filter, filterValue, filterCaseSensitive, filterAccentSensitive, filterValues, businessCalendar, searchable, visibleWhen. Group: id, header, children, collapsible, collapsed, headerTooltip. | |
rows |
readonly Row[] |
Required. Row data (never mutated). | |
rowId |
row: Row) => strin |
Required. Stable, unique, non-empty id per row. | |
rowHeight |
umber | ((row: Row) => number |
Row height in pixels (16 to 1000), or a function of the row. Default by density: 32, 40, or 48. | |
autoRowHeight |
boolean |
false |
Measure rendered rows and let them grow to their content (with wrapText columns); the scroll position stays anchored. |
layout |
DataGridLayout |
'fill' |
fill: fills the host (which needs a height). auto: grows with its rows up to the host max-block-size. |
pageSizes |
readonly number[] |
Offer a “Rows per page” choice with these sizes. | |
externalFilter |
(row: Row) => boolean |
Application filter applied with the others; call refreshFilters() when its result may change. | |
floatingFilters |
boolean |
false |
A header row of compact filter controls under the column headers: text contains, number syntax (5, >5, <=10, !=0, 5..10), date, boolean choice, set summary; complex filters show a read-only summary. |
searchBox |
boolean |
false |
A search box above the grid (role search) that sets the quick filter as the user types. |
advancedFilter |
boolean |
false |
An expression bar with type-ahead suggestions and a builder dialog replaces the column filter UI; column filters stop applying while it is on. |
rowSelection |
DataGridRowSelection<Row> | null |
Row selection: { mode: ‘single’ | ‘multiple’, checkboxes (default true; a checkbox column pinned first), headerCheckbox (default true), selectAll: ‘filtered’ (default) | ‘all’ | ‘page’, clickToSelect (default false), selectable(row) }. | |
cellSelection |
boolean | DataGridCellSelection |
Cell ranges: drag, Ctrl+drag adds, Shift+click and Shift+arrows extend, Ctrl+A selects all; { multiple (default true), columnSelection (header Enter or click selects the column; sorting moves to Alt), fillHandle (drag the corner to fill a series; Alt repeats or counts; double-click fills down) }. | |
copyHeaders |
boolean |
false |
Copy column headers above copied cells. |
readOnlyEdits |
boolean |
false |
Writes (paste, cut, Delete, fill, edits) are only requested: aui-cells-change reports them with applied: false and the application applies them. |
clickToEdit |
boolean |
false |
A single click on an editable cell starts editing (otherwise Enter, F2, typing, Backspace, or a double-click). |
enterMovesDown |
boolean |
false |
Enter commits an edit and moves to the cell below. |
invalidEdit |
"block" | "revert" |
'block' |
An invalid edit keeps the editor open with an announced message (block), or is discarded (revert). Focus leaving the editor discards an invalid value. |
undoLimit |
number |
'20' |
Undo steps kept for edits, paste, cut, Delete, fill, and bulk edit (0 turns undo off); cleared when the application replaces or updates rows. |
editMode |
"cell" | "row" |
'cell' |
row: editing opens every editable cell of the row; Tab moves within it; Enter commits the row as one write and one undo step. |
validateRow |
(values: Readonly<Record<string, unknown>>, row: Row) => string | Readonly<Record<string, string>> | null |
Row mode: cross-field validation; a message (or messages by column) blocks the commit. | |
groupDefaultExpanded |
number |
'0' |
Levels expanded by default (0: all collapsed; -1: all expanded). |
groupTotals |
"bottom" | null |
A total row after each expanded group. | |
grandTotal |
"bottom" | "top" | "pinnedTop" | "pinnedBottom" | null |
A grand total row at the top or bottom of the rows, or pinned above or below them (pinnedTop, pinnedBottom); flat grids too. | |
groupDisplay |
"columns" | "rows" | "column" |
'column' |
One generated group column indented by level, one per level (named after the grouped column; date parts in parentheses), or rows: group rows drawn as one cell across the row (no group column; not for tree data or pivot mode). |
stickyGroupRows |
boolean |
true |
While grouped, the group rows of the topmost row stay under the header as their groups scroll (copies hidden from assistive technology; their toggles work). |
fullWidthRow |
isFullWidth: (row: Row) => boolean; render: (row: Row, context: { readonly doc: Document; readonly rowId: string; }) => Node; } | nul |
Rows drawn as one cell across every column (it stays in view while the rows scroll sideways); never edited, filled, or part of ranges. | |
groupColumn |
{ header?: string; width?: number; } |
Header text and width of the generated group column. | |
hideGroupedColumns |
boolean |
true |
Hide grouped columns while grouped. |
expanded |
Readonly<Record<string, boolean>> |
Group rows expanded or collapsed explicitly, by group id. | |
groupPanel |
boolean |
false |
A panel above the grid lists the row groups: move earlier, move later, remove, add a groupable column; dropping a groupable header on it groups by that column; pills can be dragged to reorder, or out of the panel to remove (the buttons are the keyboard path). |
aggregateFilteredOnly |
boolean |
true |
Aggregates use only the rows that pass the filters; false aggregates every row of each group. |
accessories |
readonly DataGridAccessory<Row>[] |
Accessories from @absoluteui/components/data-grid/accessories: columnMenu(), contextMenu(), columnChooser() (built on Context Menu and Dialog, outside the core bundle). The grid must be in the document when they attach. | |
headerNames |
Readonly<Record<string, string>> |
Header names set by the user, by column or column group id (part of the columns state as headers). | |
pinnedTopRows |
readonly Row[] |
Rows always shown above the body in a section named “Pinned to top” (never sorted, filtered, grouped, selected, or edited; at most 1000). | |
pinnedBottomRows |
readonly Row[] |
Rows always shown below the body in a section named “Pinned to bottom”. | |
pinned |
Readonly<Record<string, "bottom" | "top">> |
Rows pinned to the top or bottom by id (they also stay in the body; filters hide the pinned copy). | |
formulas |
DataGridFormulaEngine |
The formula engine for calculated columns: formulaEngine({ functions?, calendar? }) from @absoluteui/components/data-grid/formulas (our own parser and evaluator; no eval). Results recalculate when rows change; errors show their code (#DIV/0!, #REF!, …) with the meaning read out. | |
fileDrop |
DataGridFileDrop |
Files dropped on the grid: an overlay (aui-data-grid__file-drop, default text “Drop files to load”) shows while files are over it; files matching accept (extensions such as .csv, MIME types such as text/csv or text/*; default all) go to onFiles, others are announced. Pointer only: offer a file input too. With parseCsv from @absoluteui/helpers/csv, coerceCsvValues, and inferColumns an app can load a dropped CSV with generated columns. | |
rowDragging |
boolean | DataGridRowDragging<Row> |
false |
Row dragging: a drag handle in the rowDrag column (pointer: a drop line, or a target row in parent-id tree data), and Ctrl+Shift+ArrowUp / ArrowDown on a handle cell (in trees Ctrl+Shift+ArrowRight / ArrowLeft indent and outdent); announced. managed: the grid moves the rows (one undo step) while not sorted, filtered, grouped, pivoted, or server-side; multiRow: dragging a selected row drags every selected row; canDrag limits the rows. nativeData: the handle uses native drag and drop and the drag carries that data (MIME type to text) to other apps; drops on the rows and on zones work as with the pointer. Drop zones: addRowDropZone, rowDropZone. |
rowNumbers |
boolean | { width?: number; resizable?: boolean; } |
false |
A leading column numbering the rows by display position (width 32 to 200, default 56); with cell ranges a click on a number selects the row’s cells; resizable adds a handle (drag, or Alt+ArrowUp / Alt+ArrowDown on the number) that sets the row’s height. |
datasource |
DataGridDatasource<Row> | null |
Server row model: { getRows(request, signal) => Promise<{ rows, rowCount? }> } (request: start, end, sort, filters, quickFilter, advancedFilter, groupBy, groupKeys); with groupBy the top level loads group rows and each expanded group loads its own rows; rows load in blocks as they scroll into view, and sort, filters, the quick filter, and the advanced filter run on the server (rows is ignored; pass []). An unknown rowCount grows block by block until a short block. | |
blockSize |
number |
'100' |
Rows per datasource request (1 to 10000). |
maxBlocks |
number | null |
null |
Loaded blocks kept; the least recently used are released (null keeps all). |
blockLoadDelay |
number |
'50' |
Milliseconds to wait before loading while scrolling (0 to 5000). |
maxConcurrentLoads |
number |
'2' |
Datasource requests at a time (1 to 20). |
initialRowCount |
number |
'0' |
Rows assumed before the first answer (the scrollbar size). |
getChildCount |
(row: Row) => number | null |
Server groups: the number of rows below a group row (shown with its key); null when unknown. | |
purgeClosedGroups |
boolean |
false |
Server groups: collapsing a group releases its loaded rows (they load again when it expands). |
pivotPanel |
boolean |
false |
A panel above the grid edits the pivot: rows, columns, and values zones with pills (move, remove; an aggregate per value) and pickers; pills can be dragged within and between zones (a value keeps its aggregate, a new value gets sum or count) or out of the panel to remove. |
pivotMaxColumns |
number |
'1000' |
Most generated pivot result columns (1 to 100000); more are left out, announced, and reported by getPivotTruncation(). |
detail |
DataGridDetail<Row> | null |
Master/detail: { render(row, { doc, rowId }) => Node, height (px, default 300, or auto), isMaster(row), keep (collapsed details kept, default 10), expandedByDefault, destroy(node, row) }; a generated toggle column expands a detail row under each master row. | |
treeData |
DataGridTreeData<Row> | null |
Tree data: exactly one of serverGroup with serverKey (with a datasource: parents load their children from the server when expanded), getPath (row => string[]; missing levels become filler rows), parentIdField (self-referential; missing parents and cycles become root rows), or childrenField (nested rows); label names the column that labels rows in the group column. groupBy is ignored. | |
treeFilter |
"ancestors" | "subtree" |
'ancestors' |
Filtering keeps the ancestors of matching rows; subtree also keeps the rows below a matching row. |
flashChanges |
boolean |
false |
Highlight cells whose displayed text changes when rows are updated (setRows, transactions); columns can opt in with flashOnChange. |
flashDuration |
number |
'800' |
Milliseconds a changed cell stays highlighted (100 to 10000). |
rowClassRules |
eadonly<Record<string, (row: Row) => boolean> |
Classes added to a row while their predicate is true (re-evaluated on every render). | |
loading |
boolean |
false |
Busy state: aria-busy and an announced loading overlay; rows stay in place. |
emptyMessage |
string |
Text of the single grid cell shown when there are no rows. Default “No rows to show”. | |
multiSort |
boolean |
true |
Shift+click and Shift+Enter add a column to the sort. |
sortCycle |
DataTableSortCycle |
'tri-state' |
tri-state: ascending, descending, unsorted. bi-state: ascending, descending. |
overscan |
number |
'8' |
Rows rendered beyond each edge of the viewport (0 to 200). |
transactionDelay |
number |
'50' |
Milliseconds between applying queued applyTransactionAsync batches (0 to 10000). |
animateRows |
boolean |
true |
Rows glide to their new position after a sort or update (off with reduced motion or animation none). |
filterDelay |
number |
'250' |
Milliseconds after typing stops before a typed filter value applies (0 to 10000); Enter applies at once. |
maxFilterConditions |
number |
'2' |
Conditions offered per text, number, and date filter in the filter panel (1 to 10). |
locale |
string |
'en-US' |
Formatting, collation, and messages locale. |
timezone |
string |
'UTC' |
IANA time zone for datetime columns. |
density |
Density |
'comfortable' |
Row and header heights and cell padding. |
direction |
Direction |
'ltr' |
Layout direction (pinned sides, arrow keys, resizing mirror). |
icons |
Partial<DataGridIcons> |
Icon slot overrides (sortAscending, sortDescending, sortNone, expand, collapse, loading, filter, drag). |
Two-way bindings
Section titled “Two-way bindings”| Model | Type | Change output | Description |
|---|---|---|---|
[(sort)] |
DataTableSort | readonly DataTableSort[] | null |
(sortChange) |
Current sort by priority: { column, direction: “ascending” | “descending” }. |
[(pageSize)] |
number | null |
(pageSizeChange) |
Rows per page (1 to 1,000,000); null shows every row in one virtualized grid. |
[(page)] |
number |
(pageChange) |
Current page, 1-based (clamped). |
[(filters)] |
Readonly<Record<string, DataGridFilter>> |
(filtersChange) |
Active column filters by column id (JSON models: text, number, bigint, date with relative and business ranges, boolean, set). Validated; DATA_GRID_FILTER on malformed models. |
[(quickFilter)] |
string |
(quickFilterChange) |
Rows must contain every word in some searchable visible column (case- and accent-insensitive). |
[(advancedFilterModel)] |
DataGridAdvancedGroup | null |
(advancedFilterModelChange) |
The advanced filter: { join, items } of conditions { column, filter } and nested groups. Validated (DATA_GRID_FILTER); conditions on unknown columns are dropped. |
[(selected)] |
readonly string[] |
(selectedChange) |
Selected row ids (unknown and unselectable ids are dropped; kept by id across sort, filter, paging, and updates). |
[(groupBy)] |
readonly string[] |
(groupByChange) |
Group the rows by these columns (in level order). The grid becomes a treegrid with a generated group column (key, count, expansion); grouped columns hide (hideGroupedColumns). |
[(pivot)] |
DataGridPivot | null |
(pivotChange) |
Pivot mode: { rows, columns, values: [{ column, aggregate: sum | count | avg | min | max | distinctCount }] }; rows group by the row fields, a column group per column key holds a result column per value, with total columns; the data columns hide. |
Outputs
Section titled “Outputs”| Output | Payload | Description |
|---|---|---|
(rowsChange) |
DataGridTransactionResult |
A transaction (sync or batched) changed the rows. Re-emits aui-rows-change. |
(filterChange) |
DataGridFilterChangeDetail |
The user changed a column filter, the quick filter, or the advanced filter; the row count is announced. Re-emits aui-filter-change. |
(columnsChange) |
DataGridColumnsChangeDetail |
The user (or a method) resized, moved, pinned, hid, auto-sized, or fitted columns, or toggled a column group. Re-emits aui-columns-change. |
(cellFocus) |
DataGridCellFocusDetail |
Focus moved to another cell or header. Re-emits aui-cell-focus. |
(cellActivated) |
DataGridCellActivateDetail<Row> |
Enter on a cell without widgets, or a double click. Re-emits aui-cell-activate. |
(selectionChange) |
DataGridSelectionChangeDetail |
The user changed the row selection (‘user’, ‘select-all’), or selected rows were removed (‘rows’); the count is announced for user changes. Re-emits aui-selection-change. |
(rangeChange) |
DataGridRangeChangeDetail |
The user changed the cell ranges (finished is false while a drag extends the range). Re-emits aui-range-change. |
(cellsChange) |
DataGridCellsChangeDetail |
Cells were written by an edit, bulk edit, paste, cut, Delete, fill, undo, or redo (one transaction; with readOnlyEdits only requested, applied: false); rejected lists pasted text a column could not convert. Re-emits aui-cells-change. |
(rowGroupToggled) |
DataGridRowGroupToggleDetail |
The user expanded or collapsed a group row (announced with its row count). Re-emits aui-row-group-toggle. |
(groupChange) |
DataGridGroupChangeDetail |
The user changed the row groups in the group panel (announced). Re-emits aui-group-change. |
(detailToggle) |
DataGridDetailToggleDetail |
The user expanded or collapsed a master row’s details (announced). Re-emits aui-detail-toggle. |
(rowPin) |
DataGridRowPinDetail |
The user pinned or unpinned a row (announced). Re-emits aui-row-pin. |
(rowDragStart) |
DataGridRowDragStartDetail |
The user started dragging rows with a drag handle. Re-emits aui-row-drag-start. |
(rowDrop) |
DataGridRowDropDetail |
Rows were dropped before, after, or (tree data) inside a target row, by pointer or keyboard; cancel to keep the order. Managed grids then move the rows. Re-emits aui-row-drop. |
(rowResize) |
DataGridRowResizeDetail |
The user resized a row with its row number handle (announced). Re-emits aui-row-resize. |
(pivotChanged) |
DataGridPivotChangeDetail |
The user changed the pivot in the pivot panel (announced). Re-emits aui-pivot-change. |
Read-only state
Section titled “Read-only state”| Property | Type | Description |
|---|---|---|
rowCount |
Signal<number> |
Rows displayed (the current page when paging). |
Methods
Section titled “Methods”Call them through a viewChild query or a template reference.
| Method | Description |
|---|---|
setRows(rows: readonly Row[]): void |
Replace the rows; sort, focus, and scroll position are kept. |
applyTransaction(tx: DataGridTransaction<Row>): DataGridTransactionResult | undefined |
Add, update (by id), and remove (by id) rows; sort is re-applied and rows keep their identity. Emits aui-rows-change; unknown ids are reported in missing. |
applyTransactionAsync(tx: DataGridTransaction<Row>): void |
Queue a transaction; queued ones are applied together every transactionDelay ms. |
flushTransactions(): void |
Apply queued transactions now. |
getFilters(): Readonly<Record<string, DataGridFilter>> | undefined |
Active column filters (copies). |
setFilter(column: string, filter: DataGridFilter | null): void |
Set or clear one column filter (validated; emits nothing). |
setQuickFilter(text: string): void |
Set the quick filter text (emits nothing). |
refreshFilters(): void |
Re-run the filters (for example after the external filter changed). |
getAdvancedFilter(): DataGridAdvancedGroup | null | undefined |
The advanced filter model (a copy). |
setAdvancedFilter(filter: DataGridAdvancedGroup | null): void |
Set or clear the advanced filter model (validated; emits nothing). |
getSelected(): string[] | undefined |
Selected row ids, in source order. |
getSelectedRows(): Row[] | undefined |
Selected rows, in source order. |
setSelected(ids: readonly string[]): void |
Replace the selection (validated; emits nothing). |
selectAll(scope?: DataGridSelectAllScope | undefined): void |
Select every selectable row in the scope (default: rowSelection.selectAll; emits nothing). |
clearSelection(): void |
Clear the selection (emits nothing). |
getCellRanges(): DataGridCellRange[] | undefined |
Cell ranges (copies), the active one last. |
addCellRange(range: DataGridCellRange): void |
Add a range of displayed rows and visible columns (validated; emits nothing). |
clearCellRanges(): void |
Clear the cell ranges (emits nothing). |
copySelection(): Promise<string> | undefined |
Copy the ranges, else the selected rows, else the focused cell, with the asynchronous Clipboard API; returns the tab-separated text. |
startEditing(rowId: string, column: string): boolean | undefined |
Start editing a displayed, editable cell. |
stopEditing(cancel?: boolean | undefined): void |
Commit the open edit (an invalid value is discarded) or cancel it. |
undo(): boolean | undefined |
Undo the last applied write or managed row move. |
redo(): boolean | undefined |
Redo the last undone write. |
startBatch(): void |
Collect writes as pending values (shown and spoken as edited; sorting and filtering keep committed data). |
commitBatch(): void |
Apply the pending values as one transaction and one undo step (source batch). |
cancelBatch(): void |
Discard the pending values. |
expandAll(): void |
Expand every group row (emits nothing). |
collapseAll(): void |
Collapse every group row (emits nothing). |
setExpanded(groupId: string, expanded: boolean): boolean | undefined |
Expand or collapse one group row (emits nothing). |
getGroups(): DataGridGroup[] | undefined |
The current groups: ids, columns, keys, counts, aggregates, and children. |
moveRow(id: string, parentId: string | null, index: number): boolean | undefined |
Tree data with parentIdField: move a row under another parent (null: a root) at a position among its new siblings; the row is a shallow copy (never mutated); false for unknown ids, moves into its own subtree, and other tree modes. Emits aui-rows-change. |
alignWith(other: DataGrid<unknown>): (() => void) | undefined |
Keep another grid’s columns (order, widths, pinning, visibility, collapsed groups) and horizontal scroll in step with this one, both ways (for example a totals grid under the main grid); the other grid takes this grid’s columns now. Returns a function ending it; destroying either grid ends it. |
addRowDropZone(zone: DataGridRowDropZone<Row>): (() => void) | undefined |
Let rows dragged from this grid drop on an element outside it: { element, label, onDrop, onDragEnter?, onDragMove?, onDragLeave? }, each called with { rowIds, rows, x, y, grid }. The element gets aui-data-grid-drop-zone–active while rows are over it; the cell menu’s Send to submenu lists zones by label (the keyboard path, x and y null). Returns a function removing the zone. |
rowDropZone(options?: { readonly label?: string; readonly move?: boolean; } | undefined): DataGridRowDropZone<Row> | undefined |
A zone for another grid’s addRowDropZone adding the dropped rows to this grid (at the drop line when its rows are in source order, else at the end; ids already present are skipped); move removes the added rows from the source grid. |
setColumnHeader(id: string, header: string | null): boolean | undefined |
Rename a column or column group (null restores its defined header); false for unknown ids. Emits aui-columns-change (rename). |
resetColumns(): void |
Undo the user’s column changes (order, widths, pinning, visibility, collapsed groups, names). Emits aui-columns-change (reset). |
pinRow(rowId: string, side: "bottom" | "top" | null): boolean | undefined |
Pin a row by id to the top or bottom, or unpin it; false for unknown ids (emits nothing). |
getPinnedRows(): { top: string[]; bottom: string[]; } | undefined |
Ids of the rows pinned by id, by section, in pin order. |
setRowHeight(rowId: string, height: number | null): void |
Set a row’s height in px (16 to 2000), or null for its default height (emits nothing). |
applyServerTransaction(tx: DataGridServerTransaction<Row>): DataGridTransactionResult | undefined |
Server row model: apply changes the server already holds to the loaded rows (add at addIndex, update, remove by id; later rows shift; rowCount corrects the total); rows that are not loaded are reported missing. Emits aui-rows-change. |
getServerSelection(): { selectAll: boolean; toggled: string[]; } | undefined |
Server row model: the selection state; with selectAll, toggled lists the rows not selected. |
setServerSelection(state: { readonly selectAll: boolean; readonly toggled: readonly string[]; }): void | undefined |
Server row model: set the selection state (multiple selection only; emits nothing). |
refresh(options?: { purge?: boolean; route?: readonly unknown[]; } | undefined): void | undefined |
Server row model: reload the loaded blocks; purge drops them first (loading rows show). |
retryLoads(): void |
Server row model: load failed blocks again (never done automatically). |
setRowCount(count: number, known?: boolean | undefined): void |
Server row model: set the row count; known false keeps growing it as blocks arrive. |
isRowCountKnown(): boolean | undefined |
Server row model: whether the total row count is known (always true for client rows). |
getPivot(): DataGridPivot | null | undefined |
Pivot mode: the current pivot, or null. |
setPivot(pivot: DataGridPivot | null): void |
Pivot mode: set the pivot; null leaves pivot mode (emits nothing). |
getPivotTruncation(): { shown: number; total: number; } | null | undefined |
Pivot mode: result columns shown and in total when pivotMaxColumns left some out, else null. |
setDetailExpanded(rowId: string, expanded: boolean): boolean | undefined |
Master/detail: expand or collapse a master row’s details; false for rows without details (emits nothing). |
isDetailExpanded(rowId: string): boolean | undefined |
Master/detail: whether a master row’s details are expanded. |
getTreeOrphans(): string[] | undefined |
Tree data: ids of rows whose parent is missing or would form a cycle (shown as root rows). |
toCsv(options?: DataGridCsvOptions<Row> | undefined): string | undefined |
RFC 4180 CSV with formula-injection protection (text starting with =, +, -, |
toCsvBlob(options?: DataGridCsvOptions<Row> | undefined): Blob | undefined |
toCsv() as a text/csv Blob; downloadCsv from the Data Table entry saves it. |
cellAddress(rowId: string, column: string): string | null | undefined |
A cell’s stable A1 address for formulas (column letters by column definition order, row numbers by source row order), or null without formula columns. |
cellFormula(rowId: string, column: string): string | null | undefined |
A cell’s formula: the calculated column’s formula or the cell formula; null for plain values. |
getExportData(options?: DataGridExportOptions | undefined): DataGridExportData<Row> | undefined |
The rows and columns of an export for exporters such as toXlsx in |
print(options?: DataGridPrintOptions | undefined): void |
Print the rows as a static table shown only in print media (the page itself is hidden while printing): the toCsv row and column choices (columns, rows, groups, pinned), a title (default: the grid label) as the caption, column group headers repeated on every page, group and total rows, the grid direction, and print colors. The table is removed after afterprint. More than 20,000 rows throws DATA_GRID_PRINT (page the grid or export CSV). |
getState(): DataGridState | undefined |
Serializable view state: sort, columns (order, widths, pinned, hidden, collapsed groups), page, page size; includes details (master rows expanded or collapsed), pinnedRows (pinned by id), and pivot. |
setState(state: unknown): void |
Restore a view state; untrusted input is validated (DATA_GRID_STATE), unknown ids are dropped; emits nothing. |
getColumnsState(): DataGridColumnsState | undefined |
The columns section of the state. |
moveColumn(id: string, target: string, position?: "before" | "after" | undefined): boolean | undefined |
Move a column or group next to a sibling with the same parent group. |
setColumnPinned(id: string, pinned: DataGridPinned | null): boolean | undefined |
Pin to the start or end edge, or unpin. |
setColumnHidden(id: string, hidden: boolean): boolean | undefined |
Hide or show a column (one always stays visible). |
autoSizeColumns(ids?: readonly string[] | undefined): void |
Size columns to their header and rendered cells. |
fitColumns(): void |
Scale the visible columns to the viewport width. |
focusCell(rowId: string, column: string): boolean | undefined |
Move focus to a cell, scrolling it into view. |
scrollToRow(rowId: string): boolean | undefined |
Scroll a row into view. |
scrollToColumn(column: string): boolean | undefined |
Scroll a column into view. |