Kaizen
Browse modulesData tabledatatable/sharedFunctions

Function: rowsToCsv()

function rowsToCsv<TRow>(columns: readonly DataColumnConfig<TRow>[], rows: readonly TRow[]): string;

Defined in: shared/datatable/lib/export-csv.ts:196

Serialize DataTable rows to CSV using a column config. The header is each column's header (falling back to a humanized form of its key, matching the on-screen header); each cell is getCellText. This is the bridge that keeps an export column-for-column identical to the table. Rows must already be assembled in memory (all matching rows for a filtered export, or the loaded page for a client-only table).

Type Parameters

Type Parameter
TRow

Parameters

ParameterType
columnsreadonly DataColumnConfig<TRow>[]
rowsreadonly TRow[]

Returns

string

On this page