Skip to main content
cngx-src documentation

SortHeaderState

Interface

projects/common/data/sort/sort-header-state.ts

Import#

import { SortHeaderState } from '@cngx/common/data'

Description#

The derived sort-header state a header directive exposes for one column.

Pure derivation over a single CngxSort source plus an imperative toggle. No async state, no signal writes outside toggle.

Index#

Instance Properties#

entry#Signal
Readonly

The active sort entry for this column, or undefined when the column is not sorted.

isActive#Signal
Readonly

true when this column is part of the active sort (primary or secondary).

isAsc#Signal
Readonly

true when this column is active and sorted ascending.

isDesc#Signal
Readonly

true when this column is active and sorted descending.

priority#Signal
Readonly

1-based position of this column in the sort stack, or 0 when it is not active. Only meaningful when multiSort is enabled on the owning CngxSort.

Methods#

toggle#void
toggle(additive?: boolean)

Toggles this column's sort through CngxSort.setSort. Pass the header's own Shift-key read as additive; the multiSort gate is applied here so the column only joins the stack additively when the owning sort allows it.

@paramadditive?boolean