DataGridElement (Plugin API)
Internal API for plugin developers. Members marked with @internal Plugin API
or using the _underscore prefix convention.
See the public API documentation for consumer-facing members.
| Prefix | Meaning |
|---|---|
| (none) | Public API |
_ | Protected/plugin-accessible |
__ | Deeply internal (not documented) |
Events
Section titled “Events”| Event | Description | Triggered By |
|---|---|---|
cell-activate | Unified activation event (cancelable) - fires FIRST | _dispatchCellClick() |
cell-click | Emitted after plugins process the click, with full cell context | _dispatchCellClick() |
row-click | Emitted after plugins process the click, with full row context | _dispatchRowClick() |
Properties
Section titled “Properties”| Property | Type | Description |
|---|---|---|
_rows | T[] | |
_headerRowEl | HTMLElement | |
_bodyEl | HTMLElement | |
_rowPool | RowElementInternal[] | |
_resizeController | ResizeController | |
_focusRow | number | |
_focusCol | number | |
_restoreFocusAfterRender | boolean | Flag to restore focus styling after next render. |
_sortState | object | unknown | |
_gridTemplate | string |
Event Dispatching
Section titled “Event Dispatching”Plugin API - called by event-delegation.ts
_dispatchCellMouseDown()
Section titled “_dispatchCellMouseDown()”Dispatch cell mouse events for drag operations. Returns true if any plugin started a drag.
_dispatchCellMouseDown(event: CellMouseEvent): booleanParameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
event | CellMouseEvent |
_dispatchCellMouseMove()
Section titled “_dispatchCellMouseMove()”Dispatch cell mouse move during drag.
_dispatchCellMouseMove(event: CellMouseEvent): voidParameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
event | CellMouseEvent |
_dispatchCellMouseUp()
Section titled “_dispatchCellMouseUp()”Dispatch cell mouse up to end drag.
_dispatchCellMouseUp(event: CellMouseEvent): voidParameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
event | CellMouseEvent |
Plugin Hooks
Section titled “Plugin Hooks”Plugin API - called by rows.ts
_afterCellRender()
Section titled “_afterCellRender()”Call afterCellRender hook on all plugins. This is called by rows.ts for each cell after it’s rendered, allowing plugins to modify cells during render rather than requiring expensive post-render DOM queries.
_afterCellRender(context: AfterCellRenderContext<T>): voidParameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
context | AfterCellRenderContext<T> |
_hasAfterCellRenderHook()
Section titled “_hasAfterCellRenderHook()”Check if any plugin has registered an afterCellRender hook. Used to skip the hook call entirely for performance when no plugins need it.
_hasAfterCellRenderHook(): boolean_afterRowRender()
Section titled “_afterRowRender()”Call afterRowRender hook on all plugins that have registered for it. Called by rows.ts after each row is completely rendered.
_afterRowRender(context: AfterRowRenderContext<T>): voidParameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
context | AfterRowRenderContext<T> | Context containing row data, index, and DOM element |
_hasAfterRowRenderHook()
Section titled “_hasAfterRowRenderHook()”Check if any plugin has registered an afterRowRender hook. Used to skip the hook call entirely for performance when no plugins need it.
_hasAfterRowRenderHook(): booleanAccessors
Section titled “Accessors”_pluginManager
Section titled “_pluginManager”Exposes plugin manager for event bus operations (subscribe/unsubscribe/emit).
Plugins access this via this.grid._pluginManager in BaseGridPlugin.on/off/emitPluginEvent.
readonly _pluginManager: PluginManager | undefined_columns
Section titled “_columns”_columns: ColumnInternal<T>[]_visibleColumns
Section titled “_visibleColumns”Visible columns only (excludes hidden). Use for rendering.
readonly _visibleColumns: ColumnInternal<T>[]_virtualization
Section titled “_virtualization”_virtualization: VirtualState_schedulerIsConnected
Section titled “_schedulerIsConnected”Whether the grid is fully connected (scheduler guard).
readonly _schedulerIsConnected: boolean_hostElement
Section titled “_hostElement”The grid’s host HTMLElement. Use instead of casting grid as unknown as HTMLElement.
readonly _hostElement: HTMLElement_renderRoot
Section titled “_renderRoot”The grid’s render root element for DOM queries.
readonly _renderRoot: HTMLElement_accordionIcons
Section titled “_accordionIcons”Get accordion expand/collapse icons from effective config.
readonly _accordionIcons: object_shellState
Section titled “_shellState”Shell state for config manager shell merging.
readonly _shellState: ShellStateMethods
Section titled “Methods”_emitDataChange()
Section titled “_emitDataChange()”_emitDataChange(): void_rebuildRowIdMap()
Section titled “_rebuildRowIdMap()”Rebuild the row ID map for O(1) lookups. Called when rows array changes.
_rebuildRowIdMap(): void_renderVisibleRows()
Section titled “_renderVisibleRows()”_renderVisibleRows(start: number, end: number, epoch: number): voidParameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
start | number | |
end | number | |
epoch | number |
_updateAriaCounts()
Section titled “_updateAriaCounts()”Updates ARIA row/col counts. Delegates to aria.ts module.
_updateAriaCounts(rowCount: number, colCount: number): voidParameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
rowCount | number | |
colCount | number |
_requestSchedulerPhase()
Section titled “_requestSchedulerPhase()”Request a render at the given phase through the scheduler.
_requestSchedulerPhase(phase: number, source: string): voidParameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
phase | number | |
source | string |
_getPluginExtraHeight()
Section titled “_getPluginExtraHeight()”Plugin extra height for spacer calculation.
_getPluginExtraHeight(): number_getPluginRowHeight()
Section titled “_getPluginRowHeight()”Plugin-specific row height override.
_getPluginRowHeight(row: T, index: number): number | undefinedParameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
row | T | |
index | number |
_getPluginExtraHeightBefore()
Section titled “_getPluginExtraHeightBefore()”Plugin extra height before a given row index.
_getPluginExtraHeightBefore(start: number): numberParameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
start | number |
_adjustPluginVirtualStart()
Section titled “_adjustPluginVirtualStart()”Let plugins adjust the virtual start index backwards.
_adjustPluginVirtualStart(start: number, scrollTop: number, rowHeight: number): number | undefinedParameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
start | number | |
scrollTop | number | |
rowHeight | number |
_afterPluginRender()
Section titled “_afterPluginRender()”Run plugin afterRender hooks.
_afterPluginRender(): void_emitPluginEvent()
Section titled “_emitPluginEvent()”Emit a plugin event through the plugin manager.
_emitPluginEvent(event: string, detail: unknown): voidParameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
event | string | |
detail | unknown |
_schedulerMergeConfig()
Section titled “_schedulerMergeConfig()”Merge effective config (FULL/COLUMNS phase).
_schedulerMergeConfig(): void_schedulerProcessColumns()
Section titled “_schedulerProcessColumns()”Process columns through plugins (COLUMNS phase).
_schedulerProcessColumns(): void_schedulerProcessRows()
Section titled “_schedulerProcessRows()”Rebuild row model through plugins (ROWS phase).
_schedulerProcessRows(): void_schedulerRenderHeader()
Section titled “_schedulerRenderHeader()”Render header DOM (HEADER phase).
_schedulerRenderHeader(): void_schedulerUpdateTemplate()
Section titled “_schedulerUpdateTemplate()”Update CSS grid template (COLUMNS phase).
_schedulerUpdateTemplate(): void_schedulerAfterRender()
Section titled “_schedulerAfterRender()”Run afterRender hooks and post-render bookkeeping (STYLE phase).
_schedulerAfterRender(): void_emit()
Section titled “_emit()”Emit a custom event from the grid.
_emit(eventName: string, detail: unknown): voidParameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
eventName | string | |
detail | unknown |
_clearRowPool()
Section titled “_clearRowPool()”Clear the row pool and body element.
_clearRowPool(): void_setup()
Section titled “_setup()”Run grid setup (DOM rebuild).
_setup(): void_applyAnimationConfig()
Section titled “_applyAnimationConfig()”Apply animation configuration to host element.
_applyAnimationConfig(config: GridConfig<T>): voidParameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
config | GridConfig<T> |
_dispatchCellClick()
Section titled “_dispatchCellClick()”Dispatch a cell click event to the plugin system, then emit a public event.
Plugins get first chance to handle the event. After plugins process it,
a cell-click CustomEvent is dispatched for external listeners.
_dispatchCellClick(event: MouseEvent, rowIndex: number, colIndex: number, cellEl: HTMLElement): booleanParameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
event | MouseEvent | |
rowIndex | number | |
colIndex | number | |
cellEl | HTMLElement |
Returns
Section titled “Returns”boolean - true if any plugin handled (consumed) the event, or if consumer canceled
Events
Section titled “Events”| Event | Description |
|---|---|
cell-activate | Unified activation event (cancelable) - fires FIRST |
cell-click | Emitted after plugins process the click, with full cell context |
_dispatchRowClick()
Section titled “_dispatchRowClick()”Dispatch a row click event to the plugin system, then emit a public event.
Plugins get first chance to handle the event. After plugins process it,
a row-click CustomEvent is dispatched for external listeners.
_dispatchRowClick(event: MouseEvent, rowIndex: number, row: any, rowEl: HTMLElement): booleanParameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
event | MouseEvent | |
rowIndex | number | |
row | any | |
rowEl | HTMLElement |
Returns
Section titled “Returns”boolean - true if any plugin handled (consumed) the event
Events
Section titled “Events”| Event | Description |
|---|---|
row-click | Emitted after plugins process the click, with full row context |
_dispatchHeaderClick()
Section titled “_dispatchHeaderClick()”Dispatch a header click event to the plugin system. Returns true if any plugin handled the event.
_dispatchHeaderClick(event: MouseEvent | KeyboardEvent, col: ColumnConfig, headerEl: HTMLElement): booleanParameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
event | MouseEvent | KeyboardEvent | |
col | ColumnConfig | |
headerEl | HTMLElement |
_dispatchKeyDown()
Section titled “_dispatchKeyDown()”Dispatch a keyboard event to the plugin system. Returns true if any plugin handled the event.
_dispatchKeyDown(event: KeyboardEvent): booleanParameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
event | KeyboardEvent |
_getHorizontalScrollOffsets()
Section titled “_getHorizontalScrollOffsets()”Get horizontal scroll boundary offsets from plugins. Used by keyboard navigation to ensure focused cells are fully visible when plugins like pinned columns obscure part of the scroll area.
_getHorizontalScrollOffsets(rowEl: HTMLElement, focusedCell: HTMLElement): objectParameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
rowEl | HTMLElement | |
focusedCell | HTMLElement |
_getRowEntry()
Section titled “_getRowEntry()”Get a row and its current index by ID.
Used internally by plugins to resolve a row’s current position in _rows
after sorting, filtering, or rows replacement.
_getRowEntry(id: string): object | undefinedParameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
id | string |
refreshShellHeader()
Section titled “refreshShellHeader()”Re-parse light DOM shell elements and refresh shell header. Call this after dynamically modifying <tbw-grid-header> children.
Multiple calls are batched via microtask to avoid redundant DOM rebuilds when registering multiple tool panels in sequence.
Plugin API
refreshShellHeader(): void