Members
-
highlightHighlight
-
Visualization layer.
-
inProgressboolean
-
The flag which determines if the selection is in progress.
-
selectedByColumnHeaderSet.<number>
-
The collection of the selection layer levels where the whole column was selected using the column header or
the corner header. -
selectedByCornerboolean
-
The flag indicates that selection was performed by clicking the corner overlay.
-
selectedByRowHeaderSet.<number>
-
The collection of the selection layer levels where the whole row was selected using the row header or
the corner header. -
selectedRangeSelectionRange
-
Selection data layer (handle visual coordinates).
-
settingsGridSettings
-
Handsontable settings instance.
-
tablePropsobject
-
An additional object with dynamically defined properties which describes table state.
-
transformationTransformation
-
The module for modifying coordinates.
Methods
-
begin()
-
Indicate that selection process began. It sets internaly
.inProgress
property totrue
. -
clear()
-
Clear the selection by resetting the collected ranges and highlights.
-
deselect()
-
Deselects all selected cells.
-
finish()
-
Indicate that selection process finished. It sets internaly
.inProgress
property tofalse
. -
getLayerLevel(){number}
-
Returns currently used layer level.
Returns: {number} Returns layer level starting from 0. If no selection was added to the table -1 is returned.
-
getSelectedRange(){SelectionRange}
-
Get data layer for current selection.
Returns: {SelectionRange}
-
inInSelection(coords){boolean}
-
Returns
true
if coords is within selection coords. This method iterates through all selection layers to check if
the coords object is within selection range.Parameters:
Name Type Description coords
CellCoords The CellCoords instance with defined visual coordinates.
Returns: {boolean}
-
isAreaCornerVisible(layerLevel){boolean}
-
Returns
true
if the area corner should be visible.Parameters:
Name Type Description layerLevel
number The layer level.
Returns: {boolean}
true
if the corner element has to be visible,false
otherwise. -
isEntireColumnSelected(layerLevel){boolean}
-
Returns
true
if the selection consists of entire columns (including their headers). If thelayerLevel
argument is passed then only that layer will be checked. Otherwise, it checks the selection for all layers.Parameters:
Name Type Default Description layerLevel
number this.getLayerLevel() optional Selection layer level to check.
Returns: {boolean}
-
isEntireRowSelected(layerLevel){boolean}
-
Returns
true
if the selection consists of entire rows (including their headers). If thelayerLevel
argument is passed then only that layer will be checked. Otherwise, it checks the selection for all layers.Parameters:
Name Type Default Description layerLevel
number this.getLayerLevel() optional Selection layer level to check.
Returns: {boolean}
-
isInProgress(){boolean}
-
Check if the process of selecting the cell/cells is in progress.
Returns: {boolean}
-
isMultiple(){boolean}
-
Returns information if we have a multiselection. This method check multiselection only on the latest layer of
the selection.Returns: {boolean}
-
isSelected(){boolean}
-
Returns
true
if currently there is a selection on the screen,false
otherwise.Returns: {boolean}
-
isSelectedByAnyHeader(){boolean}
-
Returns
true
if the selection was applied by clicking on the row or column header on any layer level.Returns: {boolean}
-
isSelectedByColumnHeader(layerLevel){boolean}
-
Returns
true
if the selection was applied by clicking to the column header. If thelayerLevel
argument is passed then only that layer will be checked. Otherwise, it checks if any column header
was clicked on any selection layer level.Parameters:
Name Type Default Description layerLevel
number this.getLayerLevel() optional Selection layer level to check.
Returns: {boolean}
-
isSelectedByCorner(){boolean}
-
Returns
true
if the selection was applied by clicking on the left-top corner overlay.Returns: {boolean}
-
isSelectedByRowHeader(layerLevel){boolean}
-
Returns
true
if the selection was applied by clicking to the row header. If thelayerLevel
argument is passed then only that layer will be checked. Otherwise, it checks if any row header
was clicked on any selection layer level.Parameters:
Name Type Default Description layerLevel
number this.getLayerLevel() optional Selection layer level to check.
Returns: {boolean}
-
refresh()
-
Rewrite the rendered state of the selection as visual selection may have a new representation in the DOM.
-
selectAll(includeRowHeaders, includeColumnHeaders)
-
Select all cells.
Parameters:
Name Type Default Description includeRowHeaders
boolean false optional true
If the selection should include the row headers,false
otherwise.includeColumnHeaders
boolean false optional true
If the selection should include the column headers,false
otherwise. -
selectCells(selectionRanges){boolean}
-
Make multiple, non-contiguous selection specified by
row
andcolumn
values or a range of cells
finishing atendRow
,endColumn
. The method supports two input formats, first as an array of arrays such
as[[rowStart, columnStart, rowEnd, columnEnd]]
and second format as an array of CellRange objects.
If the passed ranges have another format the exception will be thrown.Parameters:
Name Type Description selectionRanges
Array.<Array> | Array.<CellRange> The coordinates which define what the cells should be selected.
Returns: {boolean} Returns
true
if selection was successful,false
otherwise. -
selectColumns(startColumn, endColumn){boolean}
-
Select column specified by
startColumn
visual index or column property or a range of columns finishing at
endColumn
.Parameters:
Name Type Description startColumn
number | string Visual column index or column property from which the selection starts.
endColumn
number | string optional Visual column index or column property from to the selection finishes.
Returns: {boolean} Returns
true
if selection was successful,false
otherwise. -
selectRows(startRow, endRow){boolean}
-
Select row specified by
startRow
visual index or a range of rows finishing atendRow
.Parameters:
Name Type Description startRow
number Visual row index from which the selection starts.
endRow
number optional Visual row index from to the selection finishes.
Returns: {boolean} Returns
true
if selection was successful,false
otherwise. -
setRangeEnd(coords)
-
Ends selection range on given coordinate object.
Parameters:
Name Type Description coords
CellCoords Visual coords.
-
setRangeStart(coords, multipleSelection, fragment)
-
Starts selection range on given coordinate object.
Parameters:
Name Type Default Description coords
CellCoords Visual coords.
multipleSelection
boolean optional If
true
, selection will be worked in 'multiple' mode. This option works
only when 'selectionMode' is set as 'multiple'. If the argument is not defined
the default trigger will be used (isPressedCtrlKey() helper).fragment
boolean false optional If
true
, the selection will be treated as a partial selection where the
setRangeEnd
method won't be called on everysetRangeStart
call. -
setRangeStartOnly(coords, multipleSelection)
-
Starts selection range on given coordinate object.
Parameters:
Name Type Description coords
CellCoords Visual coords.
multipleSelection
boolean optional If
true
, selection will be worked in 'multiple' mode. This option works
only when 'selectionMode' is set as 'multiple'. If the argument is not defined
the default trigger will be used (isPressedCtrlKey() helper). -
transformEnd(rowDelta, colDelta)
-
Sets selection end cell relative to the current selection end cell (if possible).
Parameters:
Name Type Description rowDelta
number Rows number to move, value can be passed as negative number.
colDelta
number Columns number to move, value can be passed as negative number.
-
transformStart(rowDelta, colDelta, force)
-
Selects cell relative to the current cell (if possible).
Parameters:
Name Type Description rowDelta
number Rows number to move, value can be passed as negative number.
colDelta
number Columns number to move, value can be passed as negative number.
force
boolean If
true
the new rows/columns will be created if necessary. Otherwise, row/column will
be created according tominSpareRows/minSpareCols
settings of Handsontable.