In DataTable, you can specify different types of selection depending on your needs.
Available modes are:
Area selection is available in PRO version only
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 |
|
single row |
|
single column |
|
multiple cells |
|
multiple rows |
|
multiple columns |
|
visual block selection |
|
For example, to set in your DataTable multi row selection, you should use the following code:
Enabling multi row selection
webix.ui({
view:"datatable",
select:"row",
multiselect:true
});
Related sample: Multi-Row Selection
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 |
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 DataTable |