transformDataTableItem

DataTable
stable

Convert one raw data object to an IDataTableItem with a normalised `value`, `key`, `selectable` flag, pre-resolved per-column values, and the original `raw` reference. Used internally by transformDataTableItems.

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 that drive value/key resolution: `itemValue`, `itemSelectable`, `returnObject`, and `itemProps`.
item
required
any
The raw data row object to normalise.
index
required
number
Zero-based position of the item in its parent array, stored on the result as `index`.
columns
required
Array<IInternalDataTableHeader>
The resolved column descriptors. Each column with a non-null `key` gets its value pre-extracted into `result.columns`.

API

Return value

The value returned by this util.

A normalised row with `type: "item"`, `key`, `value`, `selectable`, `columns` (per-column values map), and `raw` (original object).

Usage

Examples

Ready-to-paste usage snippets.

Normalise a single table row

typescript