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, dragging a checked row moves visible checked rows before range selection. |
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 | Clicking a row checkbox toggles that data row. Header select-all toggles all currently matching data rows. |
| Shift-click | Selects the visible data-row range between the previous selected row and the clicked row. Synthetic group rows are skipped. |
| 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 checked row moves visible checked rows as a compact block. Dragging an unchecked row keeps current range/single-row behavior. |
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();
/** * Returns visible checkbox-selected rows for RowOrderPlugin integration. */ getRowOrderSelection( type: DimensionRows, draggedVisibleRowIndex: number, ): RowSelectRowOrderSelection | null;
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;getRowSelectIndex
Section titled “getRowSelectIndex”export function getRowSelectIndex( source: DataType[], physicalIndex: number,): 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,): GroupSelectionState;createGroupSelectionStateLookup
Section titled “createGroupSelectionStateLookup”export function createGroupSelectionStateLookup( selected: Set<number>, source: DataType[], matchesGroupValue: GroupValueMatcher = defaultGroupValueMatcher, orderedIndexes?: number[],): Map<number, GroupSelectionState>;getVisibleSelectableIndexes
Section titled “getVisibleSelectableIndexes”export function getVisibleSelectableIndexes( source: DataType[], items: number[],): 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[],): number;countSelectedVisibleIndexes
Section titled “countSelectedVisibleIndexes”export function countSelectedVisibleIndexes( selected: Set<number>, source: DataType[], items: number[],): 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,): 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(;RowSelectRowOrderSelection
Section titled “RowSelectRowOrderSelection”interface RowSelectRowOrderSelection { items: Map<number, DataType>; rowIndexes: number[]}ResolveRowSelectRowOrderSelectionOptions
Section titled “ResolveRowSelectRowOrderSelectionOptions”interface ResolveRowSelectRowOrderSelectionOptions { 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;};RowSelectRowOrderProvider
Section titled “RowSelectRowOrderProvider”Runtime contract exposed by RowSelectPlugin for row-order integrations.
interface RowSelectRowOrderProvider { getRowOrderSelection( type: DimensionRows, draggedVisibleRowIndex: number, ): RowSelectRowOrderSelection | null}defaultGroupValueMatcher
Section titled “defaultGroupValueMatcher”export function defaultGroupValueMatcher( row: DataType, prop: ColumnProp, value: unknown,): boolean;