AdaptableSelection
Declared in src/modules/view/State.ts
Select belongs to a view and can be defined under the view.selection property.
See the list of selection modes available to configure the mode property.
#Definition
| AdaptableCellSelection
| AdaptableSingleRowSelection
| AdaptableMultiRowSelection
| AdaptableNoSelection#Properties
#mode'single-row' | 'multi-row' | 'multi-cell' | false
Describes the selection mode of the current view.
For single row selection, mode must be set to "single-row".
For multi row selection, mode must be set to "multi-row".
For cell selection, mode must be set to "multi-cell".
For no selection, mode must be set to false.
#multiSelectTarget'all' | 'visible'
When some rows are filtered out, decides which rows the header checkbox, the group row checkboxes and rowSelectionApi.selectAll() / deselectAll() act on. Defaults to 'all'.
'all'- all the rows (or all the rows in the group), including the rows that are filtered out. The header and group checkboxes are only checked when all those rows are selected.'visible'- only the rows that pass the filter. The rows that are filtered out keep their selection. The header and group checkboxes are checked when all the visible rows are selected.
When no rows are filtered out, both values behave the same.
In 'server' mode the server applies the target: with 'all', createTdgpDataSource asks it for the counts without the filter, and rowSelectionApi.getSelectedPrimaryKeys() resolves the selection for it.
#multiSelectWith'click' | 'checkbox'
How users select rows. Defaults to 'checkbox'.
'checkbox'- while a visible column shows a selection checkbox (the checkbox column, or a column or group column withcheckboxSelection), rows are selected with the checkboxes and the spacebar; clicking a row only makes it the active row. Without a visible selection checkbox, rows are selected by clicking them, as with'click'.'click'- clicking a row selects it, with Ctrl/Cmd and Shift as modifiers. The selection checkboxes, if any, work too.
Clicking a group row selects the whole group. See How users select rows for the gestures on flat tables, grouped tables and pivot views, and for how Shift ranges handle group rows.
#persistboolean
Whether the selection is saved with the rest of the state. Defaults to true.
When false, the whole selection object (mode, value, showCheckboxColumn) is left out of the persisted state, so after a reload the view starts from the selection in its initial state. The view's keyboardNavigation is not part of selection and is still persisted.
#showCheckboxColumnboolean
If true, the view gets a checkbox column, with the id 'checkbox-column', to allow the user to easily select multiple rows.
It is a column of the view like any other: it is first unless columnOrder lists it, and columnOverrides['checkbox-column'] / columnVisibility configure it.
While the column is visible, clicking a row doesn't select it, unless multiSelectWith is 'click'.
#valueAdaptableSelectionValueMultiCell
An optional initial value for the cell selection.