Selection
In DataGrid, you can specify different types of selection depending on your needs.
Available modes are:
- cell;
- row;
- column;
- multi cell;
- multi row;
- multi column;
- block selection;
- area selection.
The desired type is set through parameters select, multiselect, blockselect, and areaselect.
The table below shows which combination of parameters you should use for each type.
| Type of selection | Related parameters |
|---|---|
| single cell |
|
For example, to set in your DataGrid multi row selection, you should use the following code:
// Enabling multi row selectionwebix.grid({ select:"row", multiselect:true});you can check the full snippet Multi-Row Selection
Related Methods
Section titled “Related Methods”| Method | Description |
|---|---|
| clearSelection | clears selection |
| getSelectedId | returns the selected cells |
| mapSelection | executes some custom method for all cells in the currently selected block |
| moveSelection | moves selection to the specified direction |
| select | selects the specified element |
| selectRange | selects the specified range of elements |
| unselect | cancels selection of the specified element |
Related Events
Section titled “Related Events”| Event | Description |
|---|---|
| onAfterSelect | fired after a cell is selected |
| onAfterUnSelect | fired after a cell is unselected |
| onBeforeSelect | fired before a cell is selected |
| onBeforeUnSelect | fired before a cell is unselected |
| onSelectChange | fired when selection is changed in DataGrid |