Options
All
  • Public
  • Public/Protected
  • All
Menu

PresentableCollection implements paging at the collection level and provides an easy way for interface components to manage common collection-related concerns.

Type parameters

  • T

Hierarchy

Index

Constructors

constructor

Properties

Protected _isDestroyed

_isDestroyed: boolean

app

currIndexEnd

currIndexEnd: Observable<number>

currIndexStart

currIndexStart: Observable<number>

currIndexStartFromOne

currIndexStartFromOne: Observable<number>

currPageNumber

currPageNumber: Observable<number>

filterPredicate

filterPredicate: function

The predicate to filter by.

Type declaration

    • (item: any): boolean
    • Parameters

      • item: any

      Returns boolean

firstPageNumber

firstPageNumber: Observable<number>

id

id: string

isFiltered

isFiltered: Observable<boolean>

isMultiplePages

isMultiplePages: Observable<boolean>

isPaginated

isPaginated: Observable<boolean>

isSorted

isSorted: Observable<boolean>

items

lastPageNumber

lastPageNumber: Observable<number>

libraryId

libraryId: string

nextPageNumber

nextPageNumber: Observable<number>

numPageShortcuts

numPageShortcuts: Observable<number>

numberOfItems

numberOfItems: Observable<number>

pageShortcuts

pageSize

pageSize: Observable<number>

prevPageNumber

prevPageNumber: Observable<number>

sortMethod

sortMethod: function

The sorting method to use.

Type declaration

    • (items: any[], predicate?: function): any[]
    • Parameters

      • items: any[]
      • Optional predicate: function
          • (a: any, b: any): number
          • Parameters

            • a: any
            • b: any

            Returns number

      Returns any[]

sortingPredicate

sortingPredicate: function

The sorting predicate to use when choosing item positions.

Type declaration

    • (a: any, b: any): number
    • Parameters

      • a: any
      • b: any

      Returns number

Static RANGE_RELATION_AFTER

RANGE_RELATION_AFTER: number

Static RANGE_RELATION_BEFORE

RANGE_RELATION_BEFORE: number

Static RANGE_RELATION_CONTAINED

RANGE_RELATION_CONTAINED: number

Static RANGE_RELATION_CONTAINS

RANGE_RELATION_CONTAINS: number

Static RANGE_RELATION_HEAD

RANGE_RELATION_HEAD: number

Static RANGE_RELATION_SAME

RANGE_RELATION_SAME: number

Static RANGE_RELATION_TAIL

RANGE_RELATION_TAIL: number

Methods

Private _calculatePageWindow

  • _calculatePageWindow(): object
  • Returns object

    • endShift: number
    • pageShift: number
    • startShift: number

Private _handlePageChange

  • _handlePageChange(value: any): void
  • Parameters

    • value: any

    Returns void

Private _highlightCorrectPageShortcut

  • _highlightCorrectPageShortcut(): void
  • Returns void

Private _maintainPageRanges

  • _maintainPageRanges(): void
  • Returns void

attachToCollection

  • Attaches to an ObservableCollection and begins mirroring it in a paginated, presentable fashion.

    Parameters

    Returns void

auto

  • auto(arg0: any, arg1: any, arg2: any): void
  • Binds a handler to an Observable or to a dojo.connect. Binding to an Observable:

    ``` this.auto(someObservable, function (newValue) { });

    with explicit scope:

    this.auto(someObservable, this, function (newValue) { });

    Alternately, pass an event name as a string to use dojo.connect:

    this.auto(window, "onclick", function () { }); ```

    Parameters

    • arg0: any

      Either an Observable (for observable bindings) or a regular object (if arg1 is a string)

    • arg1: any

      If arg0 is an Observable, a function or scope object. Otherwise, an event name (to use with dojo.connect).

    • arg2: any

      If arg0 is an Observable, a function handler.

    Returns void

cleanUp

  • cleanUp(): void
  • Disposes some event handlers and tears down state, resetting the PresentableCollection

    Returns void

defaultNativeSort

  • defaultNativeSort(items: any[], predicate?: function): any[]
  • Sorts an array using the default native sort implementation and any sorting predicate set.

    Parameters

    • items: any[]
    • Optional predicate: function
        • (a: any, b: any): number
        • Parameters

          • a: any
          • b: any

          Returns number

    Returns any[]

destroy

  • destroy(): void
  • Goes even farther than cleanUp(), releasing all resources.

    Returns void

destroyBindings

  • destroyBindings(): void

getAt

  • getAt(i: number): any
  • Gets an item from a given position in the underlying collection.

    Parameters

    • i: number

    Returns any

getLength

  • getLength(): number
  • Returns the total number of items in the underlying collection.

    Returns number

getResource

  • getResource(resourceKey: string, locale?: string): string
  • Gets a language resource from the Application's resource dictionary, given a key, and optional locale. Returns null if the resource does not exist.

    Parameters

    • resourceKey: string
    • Optional locale: string

      The locale of the resource to fetch. Defaults to the current application locale.

    Returns string

getSortedPosition

  • getSortedPosition(item: any): number
  • Uses a simple binary search to find the sorted position of an item.

    Parameters

    • item: any

    Returns number

nextPage

  • nextPage(): void
  • Increments the page number.

    Returns void

onDestroy

  • onDestroy(): void
  • Override or attach to provide custom clean-up behaviour.

    Returns void

prevPage

  • prevPage(): void
  • Decrements the page number.

    Returns void

sortCollection

  • sortCollection(): void
  • Sorts the entire underlying collection based on the current sorting predicate.

    Returns void

trackCommandHandler

  • trackCommandHandler(command: any, token: any): void
  • Tracks a subscription to an {@link geocortex.framework.commands.Command}, disposing it when this object is disposed with the destroy method.

    Parameters

    • command: any
    • token: any

    Returns void

trackSubscription

  • trackSubscription(event: any, token: any): void
  • Tracks a subscription to an {@link geocortex.framework.events.Event}, disposing it when this object is disposed with the destroy method.

    Parameters

    • event: any
    • token: any

    Returns void

unsortCollection

  • unsortCollection(): void
  • Unsorts the collection and rebinds.

    Returns void

Static getIntersectType

  • getIntersectType(startRange1: number, endRange1: number, startRange2: number, endRange2: number): number
  • Classifies an intersection type based on two pairs of indices.

    Parameters

    • startRange1: number

      is inclusive

    • endRange1: number

      is exclusive

    • startRange2: number

      is inclusive

    • endRange2: number

      is inclusive (confusing!)

    Returns number