Back to Table

TableOptions_Rows

docs/reference/interfaces/TableOptions_Rows.md

8.21.32.0 KB
Original Source

Interface: TableOptions_Rows<TFeatures, TData>

Defined in: core/rows/coreRowsFeature.types.ts:82

Extended by

Type Parameters

TFeatures

TFeatures extends TableFeatures

TData

TData extends RowData

Properties

getRowId()?

ts
optional getRowId: (originalRow, index, parent?) => string;

Defined in: core/rows/coreRowsFeature.types.ts:90

This optional function is used to derive a unique ID for any given row. If not provided the rows index is used (nested rows join together with . using their grandparents' index eg. index.index.index). If you need to identify individual rows that are originating from any server-side operations, it's suggested you use this function to return an ID that makes sense regardless of network IO/ambiguity eg. a userId, taskId, database ID field, etc.

Parameters

originalRow

TData

index

number

parent?

Row<TFeatures, TData>

Returns

string

Example

ts
getRowId: row => row.userId

getSubRows()?

ts
optional getSubRows: (originalRow, index) => readonly TData[] | undefined;

Defined in: core/rows/coreRowsFeature.types.ts:99

This optional function is used to access the sub rows for any given row. If you are using nested rows, you will need to use this function to return the sub rows object (or undefined) from the row.

Parameters

originalRow

TData

index

number

Returns

readonly TData[] | undefined

Example

ts
getSubRows: row => row.subRows