Skip to content

Selection Plugins

SelectionPlugin is the master entry point for spreadsheet-style selection in RevoGrid Pro. It composes the compatible cell, row, and column selection runtimes while keeping their existing events, configuration, and public methods available.

import {
SelectionPlugin,
rowHeaders,
} from '@revolist/revogrid-pro';
const grid = document.createElement('revo-grid');
grid.range = true;
grid.rowHeaders = rowHeaders({ showHeaderFocusBtn: false });
grid.columns = [
{ prop: 'selected', name: '', size: 52, rowSelect: true },
{ prop: 'name', name: 'Name' },
{ prop: 'team', name: 'Team' },
];
grid.plugins = [SelectionPlugin];

One registration enables Ctrl/Cmd multi-range selection, whole-row selection from row headers, whole-column selection from column headers, checkbox row selection for rowSelect columns, and optional range constraints.

RuntimeResponsibilityActivation/configuration
MultiRangeSelectionPluginDisjoint cell ranges, shared range rendering, clipboard operations, and range editsSet grid.range = true for range gestures; configure grid.multiRangeSelection when needed
RowHeaderPluginExcel-style whole-row selection and full-width row rangesConfigure grid.rowHeaders
ColumnSelectionPluginWhole-column selection from headers and keyboard shortcutsActive when the suite is installed
RowSelectPluginIndependent checkbox/programmatic row selectionAdd rowSelect: true to a column; configure grid.rowSelect when needed
RangeSelectionLimitPluginOptional row-only or column-only interactive rangesDisabled until grid.rangeSelectionLimit is set

The suite installs these runtimes in dependency order and reuses any instance that is already present. This is safe, although redundant:

grid.plugins = [SelectionPlugin, RowSelectPlugin];
// There is still only one RowSelectPlugin runtime.

Use individual plugins instead of SelectionPlugin when the application needs only a smaller subset.

The master plugin does not introduce another selection store. Each included plugin remains the sole owner of its existing state:

  • A plain cell click drops interactive row-header or column-header selection and focuses the clicked cell.
  • Row-header and column-header selection hand off to each other, so both do not compete for the active full-width/full-height range.
  • Ctrl/Cmd and Shift gestures continue to use the multi-range engine.
  • Checkbox row selection stays independent from row-header selection. It keeps its own selected rows and rowselected events.
  • Existing plugin methods are retrieved from the child runtime as before:
const plugins = await grid.getPlugins();
const ranges = plugins
.find(plugin => plugin instanceof MultiRangeSelectionPlugin)
?.getSelectedRanges();

Multi-Range Selection

Select, edit, clear, and copy disjoint cell ranges. Read the guide

Column Selection

Select, extend, and toggle complete columns. Read the guide

Row Selection

Configure checkbox rows and Excel-style row-header gestures. Read the guide

Range Selection Limit

Restrict interactive ranges to one row or one column. Read the guide

Range Copy Preview

Add the optional exact-copy drag preview. Read the guide

See the SelectionPlugin API reference for the exported class and dependency metadata.