Skip to content

@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()?

optional destroy: () => void

Defined in: src/core/grid-plugin.ts:15

Optional teardown hook; called when the grid or plugin is unregistered.

Returns

void

Inherited from

GridPlugin.destroy


onSelectedRangesChanged

onSelectedRangesChanged: EventEmitter<CellRange[]>

Defined in: src/core/selection-model.ts:15

Emits when the selected ranges change; payload is the new CellRange[].


pluginName?

optional pluginName: string

Defined in: src/core/grid-plugin.ts:13

Optional unique name used by GridPluginHost.getPluginByName for lookup.

Inherited from

GridPlugin.pluginName

Methods

init()

init(grid): void

Defined in: src/core/grid-plugin.ts:11

Called by the grid when the plugin is registered.

Parameters

grid

ISleekGrid

Host grid instance the plugin attaches to.

Returns

void

Inherited from

GridPlugin.init


refreshSelections()?

optional refreshSelections(): 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

CellRange[]

New selected ranges; implementations should normalize/clamp them.

Returns

void