Options
All
  • Public
  • Public/Protected
  • All
Menu

Class DefaultSelectionService

Default implementation of SelectionService.

Hierarchy

  • DefaultSelectionService

Implements

Index

Constructors

constructor

Properties

items

items: any[]

Collection of elements for selection.

lastProcessedIndex

lastProcessedIndex: number

Index of last selected/deselected element in items collection.

Protected selectionsList

selectionsList: SelectionTuple[] = new Array<SelectionTuple>()

Collection of SelectionTuple elements which represents currently selected items in items collection.

trackByFn

trackByFn: function
inheritdoc

Type declaration

    • (index: number, item: any): any
    • Parameters

      • index: number
      • item: any

      Returns any

Methods

checkSelection

  • checkSelection(): void

deselectAll

  • deselectAll(): void

deselectIndex

  • deselectIndex(index: number): void

Protected deselectItem

destroy

  • destroy(): void

getItemIndex

  • getItemIndex(item: any): number

getMaxSelectedIndex

  • getMaxSelectedIndex(): number

getMinSelectedIndex

  • getMinSelectedIndex(): number

getSelectedElements

  • getSelectedElements(): any[]

getSelectedIndexes

  • getSelectedIndexes(): number[]

Protected getSelectionTuple

hasSelections

  • hasSelections(): boolean

isIndexAcceptable

  • isIndexAcceptable(index: number): boolean
  • Checks that applied index is valid number and it's value is inside items boundaries.

    Parameters

    • index: number

      index to check.

    Returns boolean

    true if index is valid.

isIndexSelected

  • isIndexSelected(index: number): boolean

isRangeSelected

  • isRangeSelected(from: number, to: number): boolean

Protected processSelection

  • Performs final processing of selection/deselection of element.

    Current implementation sets {@link selected} propery of element (if it's defined).

    Parameters

    Returns void

selectAll

  • selectAll(): void

selectFirst

  • selectFirst(): void

selectIndex

  • selectIndex(index: number, savePrevious?: boolean): void

Protected selectItem

  • selectItem(selectionTuple: SelectionTuple, savePrevious?: boolean): void

selectLast

  • selectLast(): void

selectRange

  • selectRange(fromIndex: number, toIndex: number): void

toggleSelection

  • toggleSelection(index: number, savePrevious?: boolean): void

Protected trackByIdentity

  • trackByIdentity(index: number, item: any): any
  • Default tracking function that will be used if nothing was specified for trackByFn. Implements comparison by reference equality of objects.

    Parameters

    • index: number
    • item: any

    Returns any

Generated using TypeDoc