View as Markdown

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

ExportModelOptionsinterface

import type { ExportModelOptions } from '@salmonui/data-grid/engine/export';
interface ExportModelOptions<Row> {
    readonly scope?: ExportScope;
    readonly includeHiddenColumns?: boolean;
    readonly columns?: readonly (ColumnId | ExportColumnSelection)[];
    readonly rows?: readonly Row[];
    readonly rowIds?: readonly RowId[];
    readonly groups?: 'captions' | 'flatten';
    readonly collapsedGroups?: 'include' | 'exclude';
    readonly aggregates?: boolean;
    readonly hierarchy?: ExportHierarchyMode;
    readonly tree?: 'expanded' | 'all';
    readonly cell?: (ctx: ExportCellContext<Row>) => ExportCellOverride | null | undefined | void;
    readonly groupCaption?: (ctx: ExportGroupCaptionContext) => string | null | undefined | void;
    readonly aggregate?: (ctx: ExportAggregateContext) => string | {
        readonly text?: string;
        readonly style?: ExportCellStyle;
    } | null | undefined | void;
    readonly detail?: (ctx: ExportDetailContext<Row>) => ExportDetail | null | undefined | void;
    readonly headerRows?: (ctx: ExportHeaderContext<Row>) => readonly ExportHeaderRow[];
}
ExportModelOptions members (15)
NameSignatureDescription
scopeoptionalreadonly scope?: ExportScope;

Default filtered.

includeHiddenColumnsoptionalreadonly includeHiddenColumns?: boolean;

Export hidden columns too. Default false.

columnsoptionalreadonly columns?: readonly (ColumnId | ExportColumnSelection)[];

Explicit leaf columns, in export order (overrides visibility and order); objects override header text and width.

rowsoptionalreadonly rows?: readonly Row[];

Custom data: exported with the grid's columns, ungrouped, in the given order.

rowIdsoptionalreadonly rowIds?: readonly RowId[];

Explicit rows by id, in the given order (overrides scope).

groupsoptionalreadonly groups?: 'captions' | 'flatten';

Group rows: captions (default) writes caption and group footer rows; flatten writes data rows only.

collapsedGroupsoptionalreadonly collapsedGroups?: 'include' | 'exclude';

include (default) exports the rows of collapsed groups; exclude exports what the grid shows.

aggregatesoptionalreadonly aggregates?: boolean;

Aggregate rows (grid footer, group footers, caption aggregates). Default true.

hierarchyoptionalreadonly hierarchy?: ExportHierarchyMode;

Detail / hierarchy mode passed to the detail hook. Default expanded.

treeoptionalreadonly tree?: 'expanded' | 'all';

Tree mode rows: expanded (default) writes the visible rows in pre-order; all writes every kept row regardless of expansion, flagging collapsed parents and the rows they hide.

celloptionalreadonly cell?: (ctx: ExportCellContext<Row>) => ExportCellOverride | null | undefined | void;

Per-cell customization.

groupCaptionoptionalreadonly groupCaption?: (ctx: ExportGroupCaptionContext) => string | null | undefined | void;

Returns the group caption text.

aggregateoptionalreadonly aggregate?: (ctx: ExportAggregateContext) => string | { readonly text?: string; readonly style?: ExportCellStyle; } | null | undefined | void;

Returns the aggregate text, or text and style.

detailoptionalreadonly detail?: (ctx: ExportDetailContext<Row>) => ExportDetail | null | undefined | void;

A detail block written after the row, or null.

headerRowsoptionalreadonly headerRows?: (ctx: ExportHeaderContext<Row>) => readonly ExportHeaderRow[];

Replaces the header rows (custom stacked headers).