View as Markdown

API reference: @salmonui/data-grid

DataGridOutputApiinterface

import type { DataGridOutputApi } from '@salmonui/data-grid';
interface DataGridOutputApi<Row> {
    exportToExcel(options?: DataGridExcelExportOptions<Row>): Promise<ExportFile | null>;
    exportToPdf(options?: DataGridPdfExportOptions<Row>): Promise<ExportFile | null>;
    exportToCsv(options?: DataGridCsvExportOptions<Row>): Promise<ExportFile<string> | null>;
    print(options?: DataGridPrintOptions<Row>): Promise<boolean>;
}
DataGridOutputApi members (4)
NameSignatureDescription
exportToExcelexportToExcel(options?: DataGridExcelExportOptions<Row>): Promise<ExportFile | null>;

XLSX export (excelExport); resolves to the file, or null when prevented. Downloads unless download: false.

exportToPdfexportToPdf(options?: DataGridPdfExportOptions<Row>): Promise<ExportFile | null>;

PDF export (pdfExport).

exportToCsvexportToCsv(options?: DataGridCsvExportOptions<Row>): Promise<ExportFile<string> | null>;

CSV export (csvExport); no writer package needed.

printprint(options?: DataGridPrintOptions<Row>): Promise<boolean>;

Prints the grid (every row of the scope, no virtualization). Resolves false when prevented or outside a browser.