SelectionConfig
Configuration options for the selection plugin
Properties
Section titled “Properties”| Property | Type | Description |
|---|---|---|
mode | SelectionMode | Selection mode (default: ‘cell’) |
multiSelect? | boolean | Allow multiple items to be selected simultaneously (default: true). |
enabled? | boolean | Whether selection is enabled (default: true). |
triggerOn? | SelectionTrigger | Mouse event type that triggers selection (default: ‘click’). |
checkbox? | boolean | Show a checkbox column for row selection (row mode only). |
isSelectable? | SelectableCallback<T> | Callback that determines whether a specific row or cell can be selected. |
Property Details
Section titled “Property Details”multiSelect
Section titled “multiSelect”Allow multiple items to be selected simultaneously (default: true).
When false:
- Row mode: Only one row can be selected at a time. Ctrl+Click and Shift+Click behave like plain clicks (select only the clicked row). “Select all” is disabled.
- Range mode: Only one range exists at a time. Ctrl+Click starts a new range instead of adding to existing ranges.
- Cell mode: No effect (cell mode is always single-cell).
Checkbox behavior when multiSelect: false:
- Header “select all” checkbox is hidden
- Row checkboxes replace the current selection instead of toggling
Default: true
// Single row selection onlynew SelectionPlugin({ mode: 'row', multiSelect: false })
// Single row with checkbox (no "select all" in header)new SelectionPlugin({ mode: 'row', multiSelect: false, checkbox: true })enabled
Section titled “enabled”Whether selection is enabled (default: true).
When false, disables all selection interactions while keeping the plugin loaded.
Useful for temporarily disabling selection without removing the plugin.
Default: true
// Disable selection at runtimenew SelectionPlugin({ mode: 'row', enabled: false })
// Toggle via gridConfiggrid.gridConfig = { ...grid.gridConfig, selectable: false };checkbox
Section titled “checkbox”Show a checkbox column for row selection (row mode only).
When true and mode is 'row', adds a narrow utility column with checkboxes:
- Row checkboxes: Click to toggle individual row selection
- Header checkbox: Click to select/deselect all rows
- Indeterminate state shown when some (but not all) rows are selected
Checkboxes work with Shift+Click (range select) and follow isSelectable rules.
Default: false
new SelectionPlugin({ mode: 'row', checkbox: true })isSelectable
Section titled “isSelectable”Callback that determines whether a specific row or cell can be selected.
Non-selectable rows/cells:
- Don’t respond to click/keyboard selection
- Are excluded from “select all” operations
- Have visual indicator (muted styling via
[data-selectable="false"]) - Remain focusable for navigation
// Prevent selection of locked rowsnew SelectionPlugin({ mode: 'row', isSelectable: (row) => row.status !== 'locked',})
// Prevent selection of specific columns (cell/range mode)new SelectionPlugin({ mode: 'cell', isSelectable: (row, rowIndex, col) => col?.field !== 'id',})
AI assistants: For complete API documentation, implementation guides, and code examples for this library, see https://raw.githubusercontent.com/OysteinAmundsen/toolbox/main/llms-full.txt