Working with selections
Last updated
Was this helpful?
Last updated
Was this helpful?
Glide Data Grid selections are controlled via the and properties. To respond to selection changes the gridSelection must be controlled.
The contains three different elements. The current selection, the selected rows, and the selected columns.
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.
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 selection mode is enabled.