Docs
Cloudflare
CodeRabbit
Railway
WorkOS
SerpAPI
Clerk
OpenRouter
AG Grid
Netlify
Electric
Prisma
Sentry
Unkey
Cloudflare
CodeRabbit
Railway
WorkOS
SerpAPI
Clerk
OpenRouter
AG Grid
Netlify
Electric
Prisma
Sentry
Unkey
Table API Reference
Column API Reference
Row API Reference
Cell API Reference
Header API Reference
Features API Reference
Static Functions API Reference
Legacy API Reference
Static Functions API Reference

table_setSorting

Function: table_setSorting()

ts
function table_setSorting<TFeatures, TData>(table, updater): void;
function table_setSorting<TFeatures, TData>(table, updater): void;

Defined in: features/row-sorting/rowSortingFeature.utils.ts:41

Routes a sorting updater through the table's sorting change handler.

The updater may be a next SortingState array or a function of the previous sorting state, matching the instance table.setSorting behavior.

Type Parameters

TFeatures

TFeatures extends TableFeatures

TData

TData extends RowData

Parameters

table

Table_Internal<TFeatures, TData>

updater

Updater<SortingState>

Returns

void

Example

ts
table_setSorting(table, (old) => [...old, { id: 'age', desc: true }])
table_setSorting(table, (old) => [...old, { id: 'age', desc: true }])