API Reference > presentation-frontend > UnifiedSelection > SelectionHandler SelectionHandler Class A class that handles selection changes and helps to change internal the selection state. Implements IDisposable Methods Name Description constructor(props: SelectionHandlerProps): SelectionHandler Constructor. addToSelection(keys: Keys, level: number = 0): void Add to selection. clearSelection(level: number = 0): void Clear selection. dispose(): void Destructor. getSelection(level?: number): Readonly<KeySet> Get selection for the imodel managed by this handler. getSelectionLevels(): number[] Get selection levels for the imodel managed by this handler onSelectionChanged(evt: SelectionChangeEventArgs, provider: ISelectionProvider): void Protected Called when the selection changes. removeFromSelection(keys: Keys, level: number = 0): void Remove from selection. replaceSelection(keys: Keys, level: number = 0): void Change selection. shouldHandle(evt: SelectionChangeEventArgs): boolean Protected Called to check whether the event should be handled by this handler Properties Name Type Description imodel IModelConnection iModel whose selection is being handled manager Readonly SelectionManager Selection manager used by this handler to manage selection name string Name that's used as SelectionChangeEventArgs.source when making selection changes onSelect undefined | SelectionChangesListener Callback function called when selection changes rulesetId undefined | string Id of a ruleset selection changes will be associated with. Defined in presentation/frontend/src/presentation-frontend/selection/SelectionHandler.ts Line 48 Last Updated: 11 June, 2024