Options
All
  • Public
  • Public/Protected
  • All
Menu

Flattens a collection of collections as though it was a single collection with the order of all the elements preserved. Methods that manipulate the underlying collections are not supported.

Type parameters

  • T

Hierarchy

Index

Constructors

constructor

Properties

bindingEvent

bindingEvent: GeocortexEvent

The {@link geocortex.framework.events.Event} that is fired when this collection is modified.

throttleDelay

throttleDelay: number

An optional throttleDelay parameter that defines the delay between throttling operations (in milliseconds).

throttledOperations

throttledOperations: ThrottledOperation[]

An array containing all the throttled binding operations currently active on this collection, if throttling is enabled.

useThrottling

useThrottling: boolean

Whether or not to perform throttled binding on this collection. If set to true, data-binding operations across this collection will be performed asynchronously to avoid blocking the UI thread.

Methods

addItem

  • addItem(item: T): void

addItems

  • addItems(items: T[]): void

bind

  • bind(scope: any, handler: function): string
  • Binds a handler to the binding event. This handler will be executed whenever the value of the collection is modified Through an ObservableCollection call. This method returns a subscription token that can be used to unsubscribe the handler.

    Parameters

    • scope: any

      The scope to execute the handler in. This will the meaning of 'this' inside of the handler when it is called.

    • handler: function

      The handler to execute when the Observable changes.

    Returns string

clear

  • clear(): void

contains

  • contains(item: T): boolean

equals

  • equals(other: any): boolean

get

  • get(): T[]

getAt

  • getAt(index: number): T

getCollectionSource

  • Get the collection of collections exposed as a single flat collection. Changes to this collection will be automatically reflected in the aggregate.

    Returns ObservableCollection<ObservableCollection<T>>

getItems

  • getItems(): T[]

getLength

  • getLength(): number

getRange

  • getRange(begin: number, end?: number): T[]
  • Get a range of values.

    Parameters

    • begin: number

      the index of the first item to include, inclusive

    • Optional end: number

      the index of the last item to include, inclusive (inconsistent with Array.slice, consistent with other ObservableCollection events)

    Returns T[]

indexOf

  • indexOf(item: T): number

insertItem

  • insertItem(index: number, item: T): void

insertItems

  • insertItems(index: number, items: T[]): void

isEmpty

  • isEmpty(): boolean

length

  • length(): number

once

  • once(scope: any, handler: Function): string
  • Binds a handler the the binding event only once. The handler will only be executed the next time the ObservableCollection is updated. This method returns a subscription token that can be used to unsubscribe the handler.

    Parameters

    • scope: any

      The scope to execute the handler in.

    • handler: Function

      The handler to execute when the Observable changes.

    Returns string

pulse

  • pulse(): void
  • Fires the binding event twice, simulating a clear and and append of the entire collection back to its original state. See Observable.

    Returns void

removeAt

  • removeAt(index: number): void

removeItem

  • removeItem(obj: T): void

removeRange

  • removeRange(from: number, to?: number): void

removeSync

  • removeSync(): void
  • Removes the event subscriptions that were created when sync() was called. This effectively unbinds the synchronization that exists between this ObservableCollection and another ObservableCollection.

    Returns void

removeWhere

  • removeWhere(callback: function): void
  • Removes all items from this ObservableCollection where the supplied callback function returns a truthy value.

    Parameters

    • callback: function
        • (item: T): boolean
        • Parameters

          • item: T

          Returns boolean

    Returns void

set

  • set(newCollection: T[]): void

setCollectionsSource

  • Set the collection of collections that will be exposed as a single flat collection. Set to null to clear.

    Parameters

    Returns void

sync

unbind

  • unbind(token: string): boolean
  • Unbinds a binding subscription, given a valid subscription token received from a call to bind().

    Parameters

    • token: string

      The token representing the previously added subscription handler.

    Returns boolean