TanStack

table_toggleAllRowsExpanded

Function: table_toggleAllRowsExpanded()

ts
function table_toggleAllRowsExpanded<TFeatures, TData>(table, expanded?): void;

Defined in: features/row-expanding/rowExpandingFeature.utils.ts:88

Expands or collapses every row.

Passing true stores the special expanded-all state. Passing false stores an empty map. Omitting the value toggles based on whether all rows are currently expanded.

The call is a no-op (no onExpandedChange) when no row can expand or when the requested state matches the current state exactly.

Type Parameters

TFeatures

TFeatures extends TableFeatures

TData

TData extends RowData

Parameters

table

Table_Internal<TFeatures, TData>

expanded?

boolean

Returns

void

Example

ts
table_toggleAllRowsExpanded(table)