Skip to main content
cngx-src documentation

CngxTreetableRow

DirectivePrimaryv0.1.0WCAG AA

projects/data-display/treetable/treetable-row.directive.ts

Import#

import { CngxTreetableRow } from '@cngx/data-display/treetable'

Description#

Row directive applied to every rendered table row in CngxTreetable. Handles depth-based CSS indentation, hover highlight, selection styling, and the APG treegrid row semantics (aria-level, aria-posinset, aria-setsize, aria-expanded, aria-selected).

Sets the --cngx-row-depth CSS custom property on the host element so that cell padding can drive indentation via calc() in component stylesheets.

<div cngxTreetableRow [node]="node" [highlight]="highlight"></div>

Metadata#

Host#

Relationships

Index#

Inputs#

expanded#boolean | null
input()

Expansion state announced via aria-expanded. true / false for parent rows; null (the default) for leaves, which suppresses the attribute entirely - APG treegrid leaves carry no aria-expanded.

default null
highlight#
input()

When true, the row is highlighted while hovered. Typically driven by resolvedOptions().highlightRowOnHover.

default false
Required

The flat node this row represents. Required.

selected#
input()

When true, applies the cngx-treetable__row--selected CSS class. Driven by the selection model in CngxTreetable.

default false
selectionEnabled#
input()

Gates the aria-selected binding. When false (the default) the attribute is suppressed; when true it reflects selected(). Emit the state only when selection applies - a non-selectable grid must not announce every row as "not selected".

default false

Outputs#

focused#void
output()

Fires when DOM focus lands inside the row (Tab, click, or programmatic focus). CngxTreetable binds this to keep its logical focus row in sync with the real focus position.

Methods#

focus#void

Moves DOM focus onto the row's host element (the roving tab stop).

HostBindings#

BindingExpression
[style.--cngx-row-depth]node().depth
[class.cngx-treetable__row--highlighted]highlighted()
[class.cngx-treetable__row--selected]selected()
[attr.aria-level]node().depth + 1
[attr.aria-posinset]node().posinset
[attr.aria-setsize]node().setsize
[attr.aria-expanded]expanded()
[attr.aria-selected]selectionEnabled() ? selected() : null

HostListeners#

EventHandler
(focusin)focusin()