transformDataTableItems

DataTable
stable

Map an array of raw data objects to normalised IDataTableItem rows by calling transformDataTableItem for each entry. Returns an empty array when items is undefined.

API

Signature

Full TypeScript signature sourced from the util file.

typescript

API

Parameters

Input parameters accepted by this util.

props
required
Omit<IDataTableItemsProps, 'items'>
The DataTable props driving value/key/selectable resolution (same as transformDataTableItem).
items
required
Array<any> | undefined
Raw data rows to normalise. Passing `undefined` returns an empty array without throwing.
columns
required
Array<IInternalDataTableHeader>
Resolved column descriptors forwarded to transformDataTableItem for per-column value extraction.

API

Return value

The value returned by this util.

A new array of normalised rows. The length matches the input when items is defined; empty array otherwise.

Usage

Examples

Ready-to-paste usage snippets.

Normalise all rows of a table

typescript