Currently, in grids, you can "mark" multiple rows using checkboxes, as well as "select" a single row by clicking with the mouse. Some commands affect marked rows, while others affect the selected row. The difference between “marking” and “selecting” should be clear to users.
It should be possible to select both single and multiple rows (as in Excel, for example) using Ctrl/Shift.
All commands should apply to the selected row(s) in sequence and may be disabled if they do not support multiple selections. The grid’s edit mode allows only single-row selection.
The most important feature is extending the selection using “Shift”; selecting individual, non-contiguous rows using Ctrl is less important.
Desired Date: August 20, 2019
Implementation
The selection methods have been standardized so that there is no longer a difference between a row selection and a checkbox selection. A row can now be selected via a checkbox or by clicking on the row. All actions for selected rows now behave the same, regardless of how the rows were selected. // Multi-selection using CTRL/SHIFT has been implemented. Since the selection model previously used from the TableViewModel is not suitable for implementing multi-selection, the selection model has been replaced with the model from TableModel. Whether multi-selection is allowed can be configured within the selectionModelFactory using the `multiple` property.
Code Migration
GridComponent.getSelectionModel() no longer uses FormGroups for trees; instead, it uses GridTreeTableNodes. Code that uses this must be adapted accordingly. New methods were added under #24566 to facilitate switching between these object types. See the "Details" section of that ticket for more information.
The following API changes have been made:
GridComponent.initViewModel(FormContext, TableViewModel) -> GridComponent.initViewModel(TableViewModel)
Test
Since selected rows are now stored in the TableModel instead of the TableViewModel, errors or merge conflicts may occur in onReturn() in #23466, as the current row is determined there using the TableViewModel. Therefore, we need to test whether switching rows using `Return` still works correctly.