@serenity-is/sleekgrid / SelectionModel
Interface: SelectionModel
Defined in: src/core/selection-model.ts:8
Contract for a grid selection model (e.g. CellSelectionModel, RowSelectionModel).
Implements GridPlugin so it can be registered via grid.setSelectionModel().
Extends
Properties
destroy()?
optionaldestroy: () =>void
Defined in: src/core/grid-plugin.ts:15
Optional teardown hook; called when the grid or plugin is unregistered.
Returns
void
Inherited from
onSelectedRangesChanged
onSelectedRangesChanged:
EventEmitter<CellRange[]>
Defined in: src/core/selection-model.ts:15
Emits when the selected ranges change; payload is the new CellRange[].
pluginName?
optionalpluginName:string
Defined in: src/core/grid-plugin.ts:13
Optional unique name used by GridPluginHost.getPluginByName for lookup.
Inherited from
Methods
init()
init(
grid):void
Defined in: src/core/grid-plugin.ts:11
Called by the grid when the plugin is registered.
Parameters
grid
Host grid instance the plugin attaches to.
Returns
void
Inherited from
refreshSelections()?
optionalrefreshSelections():void
Defined in: src/core/selection-model.ts:20
Optional hook invoked when the grid re-renders rows; selection models can re-apply visual selection state here.
Returns
void
setSelectedRanges()
setSelectedRanges(
ranges):void
Defined in: src/core/selection-model.ts:13
Sets the current selection to the given cell ranges.
Parameters
ranges
New selected ranges; implementations should normalize/clamp them.
Returns
void