Row Select
Module Extensions
Section titled “Module Extensions”ColumnRegular (Extended from @revolist/revogrid)
Section titled “ColumnRegular (Extended from @revolist/revogrid)”interface ColumnRegular { /** * Enables checkbox on cells and columns */ rowSelect?: boolean | ((model: CellTemplateProp) => boolean);}AdditionalData (Extended from @revolist/revogrid)
Section titled “AdditionalData (Extended from @revolist/revogrid)”interface AdditionalData { /** * Row selection plugin configuration. * * @deprecated Prefer the direct `grid.rowSelect` property. */ rowSelect?: RowSelectConfig;}HTMLRevoGridElement (Extended from global)
Section titled “HTMLRevoGridElement (Extended from global)”interface HTMLRevoGridElement { /** * Row selection plugin configuration. */ rowSelect?: RowSelectConfig;}HTMLRevoGridElementEventMap (Extended from global)
Section titled “HTMLRevoGridElementEventMap (Extended from global)”interface HTMLRevoGridElementEventMap { /** * Header cell with checkbox clicked */ [ROW_ALL_SELECT_EVENT]: RowSelectAllEvent; /** * Cell with checkbox clicked in the row */ [ROW_SELECT_EVENT]: RowSelectEvent; /** * When row selection happened. Returns selected objects. */ [ROW_SELECTED_EVENT]: { selected: Map<DimensionRows, Set<number>>; visibleCount: number; visibleRowsCount: number; count: number; allRowsCount: number; };}Plugin API
Section titled “Plugin API”DEFAULT_SEL_PROP
Section titled “DEFAULT_SEL_PROP”DEFAULT_SEL_PROP: string;RowSelectPlugin
Section titled “RowSelectPlugin”The RowSelectPlugin enables checkbox-based row selection.
Quick setup:
import { RowSelectPlugin } from '@revolist/revogrid-pro';
grid.plugins = [RowSelectPlugin];grid.columns = [ { prop: 'select', name: '', rowSelect: true, size: 56 }, { prop: 'name', name: 'Name' },];Public configuration:
| API | Default | Meaning |
|---|---|---|
ColumnRegular.rowSelect | false | Renders a row checkbox for normal data cells in that column. A function can hide the checkbox for specific cells. |
grid.rowSelect | { grouping: false, rowOrder: false } | Configures optional row-select behavior. Use this for grouping checkboxes and checkbox-driven row ordering. |
additionalData.rowSelect | none | Legacy alias for grid.rowSelect. Prefer the direct grid property. |
rowSelect.grouping | false | Opt-in checkbox support for RevoGrid grouping rows. Use true or { enabled: true }. |
rowSelect.rowOrder | false | Opt-in RowOrderPlugin integration. When enabled, a drag handle selects its row and dragging a selected row moves visible selected rows as a compact block. |
Index and count semantics:
| Term | Meaning |
|---|---|
| Data row | A real row from the user source data. |
| Synthetic grouping row | A row generated by RevoGrid grouping. It can render a group checkbox, but it is never stored as selected data. |
| Physical row index | The index stored in rowselected.detail.selected. For grouped rows this maps back to the original data row index, not the synthetic group source position. |
| Visible rows | Rows currently visible after filtering, sorting, grouping expansion/collapse, tree expansion/collapse, and row ordering. |
count | Number of selected real data rows across the full data set. |
allRowsCount | Number of selectable real data rows across the full data set. Synthetic grouping rows are excluded. |
visibleCount | Number of selected real data rows currently visible. |
visibleRowsCount | Number of selectable real data rows currently visible. |
Behavior matrix:
| Case | Behavior |
|---|---|
| Flat rows | A plain checkbox click independently toggles that row. Ctrl/Cmd-click toggles one row, Shift-click replaces with an anchored visible range, and Ctrl/Cmd+Shift-click adds the range. Header select-all toggles all currently matching data rows. |
| Shift-click | Uses the most recent non-Shift row input as a fixed anchor. Synthetic group rows are skipped. |
| Row header + RowHeaderPlugin | Uses independent row-header-owned state and never changes checkbox or programmatic selection. |
| Filtering | Selection stays attached to physical data rows. rowselected is re-emitted so visible counts reflect the filtered view. |
| Sorting | Selection stays attached to physical data rows after sort order changes. rowselected is re-emitted. |
| Row drag | Selection stays attached to physical data rows after row order changes. rowselected is re-emitted. |
| Grouping disabled | Group rows do not render checkboxes, even when a row-select column exists. |
| Grouping enabled | Group rows render checkboxes only when a visible row-select column exists. |
| Group checkbox click | Selects or clears all descendant real data rows in that group. Group rows themselves are not selected. |
| Group child roll-up | Some selected children make the group checkbox indeterminate. All selected children make it checked. Ancestor groups update the same way. |
| Collapsed groups | Header select-all toggles matching real data rows, including descendants hidden by collapsed groups. |
| Tree parent click | When TreeDataPlugin is registered, clicking a tree parent checkbox toggles that parent and all descendants. |
| Tree child click | Clicking a tree leaf/child without descendants toggles only that row. |
| Checkbox row-order | When rowSelect.rowOrder is enabled, dragging a selected row moves visible selected rows as a compact block. A drag handle on an unselected row replaces selection with that row. |
Events:
| Event | Constant | Use it for |
|---|---|---|
rowselectclick | ROW_SELECT_EVENT | Internal/plugin integration point for toggling one row. |
rowallselectclick | ROW_ALL_SELECT_EVENT | Internal/plugin integration point for toggling all matching selectable rows. |
rowselected | ROW_SELECTED_EVENT | Public application event. Read selected, count, allRowsCount, visibleCount, and visibleRowsCount. |
rowselected.detail.selected is a Map<DimensionRows, Set<number>> keyed by row type.
The set contains physical indexes for real data rows only.
Dependencies
Section titled “Dependencies”- Event integration
tree-data: Integrates with TreeDataPlugin descendant selection events when present.
class RowSelectPlugin { /** * Returns physical selected row indexes */ getSelectedIndexes();
/** Resolve a physical row using this plugin’s dimension-local selection identities. */ getSelectionIndex(type: DimensionRows, physicalIndex: number): number;
/** * Replaces checkbox row selection for a row dimension. */ setSelectedIndexes(type: DimensionRows, indexes: Iterable<number>): void;
/** * Clears checkbox row selection and updates row/header checkbox state. */ clearSelection(type?: DimensionRows): void;
/** * Returns visible checkbox-selected rows for RowOrderPlugin integration. */ getRowOrderSelection( context: RowOrderSelectionContext, ): RowOrderSelection | null;
/** Whether checkbox row selection is exposed by an untrimmed grid column. */ hasVisibleCheckboxColumn(): boolean;
destroy();}RowSelectColumnType
Section titled “RowSelectColumnType”class RowSelectColumnType {}normalizeRowSelectConfig
Section titled “normalizeRowSelectConfig”Normalizes public row selection configuration to the internal shape.
export function normalizeRowSelectConfig( config?: boolean | RowSelectConfig,): NormalizedRowSelectConfig;RowSelectGroupingConfig
Section titled “RowSelectGroupingConfig”Grouped row checkbox configuration for the row selection plugin.
interface RowSelectGroupingConfig { /** * Enables checkbox rendering on RevoGrid grouping rows. * * Disabled by default. When enabled, selecting a group checkbox selects or * clears all descendant data rows while synthetic group rows stay out of the * selected index set. */ enabled?: boolean;}RowSelectRowOrderConfig
Section titled “RowSelectRowOrderConfig”Checkbox-selected row-order integration configuration.
interface RowSelectRowOrderConfig { /** * Enables RowOrderPlugin integration with checkbox-selected rows. * * Disabled by default. When enabled, dragging a checked row moves all * visible checked rows in the same row viewport as a compact block. */ enabled?: boolean;}RowSelectConfig
Section titled “RowSelectConfig”Row selection plugin configuration.
Set this on grid.rowSelect. additionalData.rowSelect is supported as a
compatibility alias, but the direct grid property is preferred.
Examples:
grid.rowSelect = { grouping: true };grid.rowSelect = { grouping: { enabled: true } };grid.rowSelect = { grouping: false };grid.rowSelect = { rowOrder: true };grid.rowSelect = { rowOrder: { enabled: true } };interface RowSelectConfig { /** * Enables row selection integration with RevoGrid grouping. * * Defaults to `false`. Use `true` for the compact form or * `{ enabled: true }` for the future-compatible object form. */ grouping?: boolean | RowSelectGroupingConfig; /** * Enables checkbox-selected row drag integration with RowOrderPlugin. * * Defaults to `false`. Use `true` for the compact form or * `{ enabled: true }` for the future-compatible object form. */ rowOrder?: boolean | RowSelectRowOrderConfig;}NormalizedRowSelectConfig
Section titled “NormalizedRowSelectConfig”Internal normalized row selection configuration.
interface NormalizedRowSelectConfig { grouping: { enabled: boolean; }; rowOrder: { enabled: boolean; };}DEFAULT_ROW_SELECT_CONFIG
Section titled “DEFAULT_ROW_SELECT_CONFIG”Default row selection configuration.
Group row checkboxes are opt-in and disabled by default.
DEFAULT_ROW_SELECT_CONFIG: { grouping: { enabled: false; } rowOrder: { enabled: false; }}isRowSelectGroupingRow
Section titled “isRowSelectGroupingRow”export function isRowSelectGroupingRow(row: DataType | undefined): boolean;RowSelectionIndex
Section titled “RowSelectionIndex”A resolver owns stable row identities for one selection dimension. Reuse the same
instance across source replacement and reordering. Separate instances isolate
grids and pinned rows, even when they share row objects. clear() releases its
current source and remembered identities.
class RowSelectionIndex { getIndex(source: DataType[], physicalIndex: number): number; clear(): void;}getRowSelectIndex
Section titled “getRowSelectIndex”Two-argument helper calls remain supported and share legacy row identities.
For an installed plugin, use plugin.getSelectionIndex(type, physicalIndex) so
actions and rendering share its dimension-local identities. Pass the same explicit
resolver to individual and batch helpers when working with plugin-owned selection.
export function getRowSelectIndex( source: DataType[], physicalIndex: number, indexes?: RowSelectionIndex,): number;collectGroupLeafIndexes
Section titled “collectGroupLeafIndexes”export function collectGroupLeafIndexes( source: DataType[], groupIndex: number, matchesGroupValue: GroupValueMatcher = defaultGroupValueMatcher, orderedIndexes?: number[],): number[];getGroupSelectionState
Section titled “getGroupSelectionState”export function getGroupSelectionState( selected: Set<number>, source: DataType[], groupIndex: number, indexes?: RowSelectionIndex,): GroupSelectionState;createGroupSelectionStateLookup
Section titled “createGroupSelectionStateLookup”export function createGroupSelectionStateLookup( selected: Set<number>, source: DataType[], matchesGroupValue: GroupValueMatcher = defaultGroupValueMatcher, orderedIndexes?: number[], indexes?: RowSelectionIndex,): Map<number, GroupSelectionState>;getVisibleSelectableIndexes
Section titled “getVisibleSelectableIndexes”export function getVisibleSelectableIndexes( source: DataType[], items: number[], indexes?: RowSelectionIndex,): number[];countSelectableIndexes
Section titled “countSelectableIndexes”export function countSelectableIndexes( source: DataType[], items: number[],): number;countSelectedIndexes
Section titled “countSelectedIndexes”export function countSelectedIndexes( selected: Set<number>, source: DataType[], indexes?: RowSelectionIndex,): number;countSelectedVisibleIndexes
Section titled “countSelectedVisibleIndexes”export function countSelectedVisibleIndexes( selected: Set<number>, source: DataType[], items: number[], indexes?: RowSelectionIndex,): number;applySelectionToIndexes
Section titled “applySelectionToIndexes”export function applySelectionToIndexes( selected: Set<number>, indexes: number[], shouldSelect: boolean,);getVisibleSelectionRange
Section titled “getVisibleSelectionRange”export function getVisibleSelectionRange( source: DataType[], items: number[], fromPhysicalIndex: number, toPhysicalIndex: number, indexes?: RowSelectionIndex,): number[];GroupSelectionState
Section titled “GroupSelectionState”interface GroupSelectionState { selected: boolean; indeterminate: boolean; selectedCount: number; totalCount: number;}ROW_SELECT_ORIGINAL_INDEX
Section titled “ROW_SELECT_ORIGINAL_INDEX”ROW_SELECT_ORIGINAL_INDEX: string;GroupValueMatcher
Section titled “GroupValueMatcher”export type GroupValueMatcher = ( row: DataType, prop: ColumnProp, value: unknown,) => boolean;resolveRowSelectRowOrderSelection
Section titled “resolveRowSelectRowOrderSelection”export function resolveRowSelectRowOrderSelection({ draggedVisibleRowIndex, enabled, selected, source, visibleItems,}: ResolveRowSelectRowOrderSelectionOptions): RowOrderSelection | null;ResolveRowSelectRowOrderSelectionOptions
Section titled “ResolveRowSelectRowOrderSelectionOptions”interface ResolveRowSelectRowOrderSelectionOptions { indexes?: RowSelectionIndex; draggedVisibleRowIndex: number; enabled: boolean; selected: Set<number> | undefined; source: DataType[]; visibleItems: number[];}RowSelectEvent (Extended from index.ts)
Section titled “RowSelectEvent (Extended from index.ts)”export type RowSelectEvent = CellTemplateProp & { originalEvent: MouseEvent };RowSelectAllEvent (Extended from index.ts)
Section titled “RowSelectAllEvent (Extended from index.ts)”export type RowSelectAllEvent = ColumnTemplateProp & { selected: boolean; type: DimensionCols;};defaultGroupValueMatcher
Section titled “defaultGroupValueMatcher”export function defaultGroupValueMatcher( row: DataType, prop: ColumnProp, value: unknown, emptyGroupValue: unknown = '',): boolean;