Skip to content

@jsvision/datagrid / SortHeaderConfig

Interface: SortHeaderConfig<T>

Defined in: datagrid/src/sort-header.ts:34

Construction config for SortHeader.

Type Parameters

T

T

Properties

autoWidths

autoWidths: () => (number | null)[]

Defined in: datagrid/src/sort-header.ts:40

The memoized auto-width measurement (shared with the body).

Returns

(number | null)[]


columnIds

columnIds: readonly string[]

Defined in: datagrid/src/sort-header.ts:38

Column ids parallel to columns (index → columnId), so a click resolves to a stable id.


columnOffset?

optional columnOffset?: number

Defined in: datagrid/src/sort-header.ts:92

This panel's start index in the global visible order (default 0), added to a local column index so onColumnReorder reports global visible indices. 0 for a single body.


columns

columns: Column<T>[]

Defined in: datagrid/src/sort-header.ts:36

The engine columns (titles + sizing) — shared with the body so geometry never disagrees.


compact?

optional compact?: boolean

Defined in: datagrid/src/sort-header.ts:97

Compact density (default false): drop the inter-column divider, reclaiming its cell so columns pack tighter. Must match the body/quick-filter setting so header and body stay column-aligned.


filterable?

optional filterable?: boolean[]

Defined in: datagrid/src/sort-header.ts:102

Per-column filterability, parallel to columns (index → filterable). A false column shows no funnel and its funnel cell is not hit-testable. Omit to make every column filterable.


filterModel

filterModel: Signal<FilterModel>

Defined in: datagrid/src/sort-header.ts:48

The container's filter model, read to render the funnel on columns that have an active filter.


indent

indent: Signal<number>

Defined in: datagrid/src/sort-header.ts:42

The horizontal cell offset (shared with the body — header and body pan in lockstep).


onColumnAutoFit?

optional onColumnAutoFit?: (columnId) => void

Defined in: datagrid/src/sort-header.ts:68

Reports a double-click on a column's grip: the columnId to auto-fit to its widest visible cell. Optional — omit to disable grip auto-fit.

Parameters

columnId

string

Returns

void


onColumnReorder?

optional onColumnReorder?: (fromVisible, toVisible) => void

Defined in: datagrid/src/sort-header.ts:81

Reports a committed column reorder (a title press-drag-drop): the from and to indices in the global visible order (this panel's local index plus columnOffset). The target is constrained to this panel, so from/to never cross a freeze boundary. Optional — a header without it has no reorder gesture (a title stays a plain sort click).

Parameters

fromVisible

number

toVisible

number

Returns

void


onColumnResize?

optional onColumnResize?: (columnId, width) => void

Defined in: datagrid/src/sort-header.ts:63

Reports a live column resize (a captured drag on a column's right-edge grip): the columnId and the new width in cells, already clamped to the column's [minWidth, maxWidth]. Fired on every captured drag so the grid resizes live. Optional — a header without it has no resize grips (a sort/filter-only grid is unaffected).

Parameters

columnId

string

width

number

Returns

void


onFunnelClick

onFunnelClick: (columnId, anchor, ev) => void

Defined in: datagrid/src/sort-header.ts:56

Reports a funnel-cell click: the clicked columnId, the funnel cell's header-local anchor (for positioning the filter popup), and the live dispatch envelope. The envelope is forwarded because the focus/popup seam (ev.focusView / ev.popupHost) lives on it — the container needs it to focus the mounted popup and to let the popup's nested dropdowns open (a ComboBox/DatePicker silently no-ops without ev.popupHost). The {x,y} anchor alone is not sufficient.

Parameters

columnId

string

anchor
x

number

y

number

ev

DispatchEvent

Returns

void


onHeaderClick

onHeaderClick: (columnId, additive) => void

Defined in: datagrid/src/sort-header.ts:46

Reports a header click: the clicked columnId and whether Ctrl was held (an additive multi-key click).

Parameters

columnId

string

additive

boolean

Returns

void


onReorderStart?

optional onReorderStart?: () => void

Defined in: datagrid/src/sort-header.ts:87

Fired once, when a title press turns into a reorder drag (the pointer moved past the threshold). The container uses it to revert the sort the press triggered on mouse-down, so a drag reorders without a net sort while a plain click still sorts. Optional — pairs with onColumnReorder.

Returns

void


showFunnel?

optional showFunnel?: boolean[]

Defined in: datagrid/src/sort-header.ts:109

Per-column always-visible funnel opt-in, parallel to columns (index → showFunnel). A true column draws its funnel at all times (muted when unfiltered, emphasized when filtered); a false column draws the funnel only while it has an active filter (default: a clean header otherwise). Ignored where filterable is false. Omit to default every column to false.


sort

sort: Signal<SortKey[]>

Defined in: datagrid/src/sort-header.ts:44

The container's sort model, read to render the indicators.


widthTick?

optional widthTick?: () => unknown

Defined in: datagrid/src/sort-header.ts:74

A reactive column-geometry trigger, bound for repaint so a width-override change (a live resize / auto-fit) re-apportions the header — draw reads widths through the column objects but does not auto-track. Omit when the grid has no resizable columns.

Returns

unknown