View as Markdown

API reference: @salmonui/data-grid/engine/export-server

ExportDataGridOptionsinterface

import type { ExportDataGridOptions } from '@salmonui/data-grid/engine/export-server';
interface ExportDataGridOptions<Row> {
    readonly rows: readonly Row[];
    readonly columns: readonly ColumnDef<Row>[];
    readonly getRowId?: (row: Row, index: number) => RowId;
    readonly query?: DataGridQueryInit;
    readonly state?: DataGridState | string;
    readonly locale?: string;
    readonly timeZone?: string;
    readonly currency?: string;
    readonly direction?: 'ltr' | 'rtl';
    readonly tree?: TreeOptions<Row> | true;
}

Rows and columns of a headless export grid.

ExportDataGridOptions members (10)
NameSignatureDescription
rowsreadonly rows: readonly Row[];
columnsreadonly columns: readonly ColumnDef<Row>[];
getRowIdoptionalreadonly getRowId?: (row: Row, index: number) => RowId;

Default: the primaryKey column's value, else the row index.

queryoptionalreadonly query?: DataGridQueryInit;

Sorting, filters, search, grouping, aggregates, and paging.

stateoptionalreadonly state?: DataGridState | string;

A client grid state (getState(), or its serializeDataGridState text), applied after query.

localeoptionalreadonly locale?: string;
timeZoneoptionalreadonly timeZone?: string;
currencyoptionalreadonly currency?: string;
directionoptionalreadonly direction?: 'ltr' | 'rtl';
treeoptionalreadonly tree?: TreeOptions<Row> | true;

Tree mode: the same tree options as the client grid (true means nested rows under children). Nested rows are flattened here; a client state restores tree.expandedRows. The export model then carries each row's depth, so XLSX outlines, PDF indentation, and the CSV depth column equal the client export.