Skip to main content

Function: buildSortHref()

buildSortHref(basePath, params, col, current): string

Defined in: src/lib/table/sort.ts:50

Build the href for clicking a column header: toggles direction when the column is already the active sort, otherwise sorts ascending by it. Preserves all other params (filters, search) and drops pagination so the user lands on the first page of the new sort.

Parameters

basePath

string

params

Params

col

string

current

Sort

Returns

string