Focus & Scrolling
NextGrid decouples logical focus (FocusPosition) from recycled DOM elements so focus survives virtualized scrolling and data updates.
Reading & Setting Focus
Section titled “Reading & Setting Focus”grid.getFocusPosition()returns the currentFocusPosition('cell','header','fullWidth','region','pivotResult', ornull).- Target-specific setters accept
{ focusDom?: boolean, ensureVisible?: boolean }(FocusOptions):grid.setFocusedCell(cell, options?)grid.setFocusedHeader(colId, options?)grid.setFocusedFullWidthRow(row, options?)grid.setFocusedRegionCell(address, colId, options?)grid.setFocusedDisplayCell(cell, options?)grid.setFocusedPivotCell(cell, options?)
Scrolling Targets Into View
Section titled “Scrolling Targets Into View”Pass ScrollAlignment ('nearest' | 'start' | 'center' | 'end') where supported:
grid.ensureRowVisible(row, alignment?)grid.ensureColumnVisible(colId, alignment?)grid.ensureCellVisible(cell, alignment?)grid.ensureDisplayNodeVisible(address, alignment?)grid.ensureRegionCellVisible(address, colId)grid.ensurePivotCellVisible(cell)
Every focus change emits focusChanged with focus and previousFocus.