Skip to content

SelectionMode

Since v0.1.1

Selection mode for the grid.

Each mode offers different selection behavior suited to different use cases:

ModeUse CaseBehavior
'cell'Spreadsheet-style editingSingle cell focus. Click to select one cell at a time.
'row'Record-based operationsFull row selection. Click anywhere to select the entire row.
'column'Spreadsheet-style column operationsFull column selection. Activated via Ctrl+Click on header or Ctrl+Space on a focused cell.
'range'Bulk operations, exportRectangular selection. Drag or Shift+Click to select ranges.

mode may also be an array to enable column selection alongside one in-row mode (['row', 'column'], ['cell', 'column'], or ['range', 'column']). When both axes are enabled, they are mutually exclusive at runtime — selecting a column clears any row selection, and selecting a row clears any column selection. Only column-paired arrays are valid; combining other modes (e.g. ['row', 'cell']) throws at attach time.

type SelectionMode = "cell" | "row" | "column" | "range"
// Cell mode (default) - for spreadsheet-like interaction
new SelectionPlugin({ mode: 'cell' })
// Row mode - for selecting complete records
new SelectionPlugin({ mode: 'row' })
// Column mode - for column-wise operations (copy column, hide column)
new SelectionPlugin({ mode: 'column' })
// Range mode - for bulk copy/paste operations
new SelectionPlugin({ mode: 'range' })
// Both row and column - mutually exclusive at runtime
new SelectionPlugin({ mode: ['row', 'column'] })
  • Cell Mode Demo — Click cells to select
  • Row Mode Demo — Full row selection
  • Range Mode Demo — Drag to select ranges
AI assistants: For complete API documentation, implementation guides, and code examples for this library, see https://toolboxjs.com/llms-full.txt