🖱️Working with selections
Glide Data Grid selections are controlled via the gridSelection
and onGridSelectionChanged
properties. To respond to selection changes the gridSelection must be controlled.
The GridSelection
contains three different elements. The current selection, the selected rows, and the selected columns.
The current
part of the selection contains the selected cell
. This is the item which will be drawn with a focus ring. The range
represents the selected region around the cell that may be edited by certain commands such as delete. Finally, the rangeStack
are additional ranges that the user has selected when multi-rect
selection mode is enabled.
rows
and columns
are both a CompactSelection
. A compact selection is a sparse array designed to efficiently hold spans of selected elements. They have the following interface:
In general, it is advisable not to call toArray
. Iterating over the CompactSelection
using a for ... of
loop is significantly more efficient.
Last updated