Options
All
  • Public
  • Public/Protected
  • All
Menu

Applies a filter function to a source Observable collection and only exposes values that pass the filter (returns true). Change events and getters all work as expected. Setters 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

getFilter

  • getFilter(): function
  • Returns function

      • (input: T): boolean
      • Parameters

        • input: T

        Returns boolean

getItems

  • getItems(): T[]

getLength

  • getLength(): number

getRange

  • getRange(begin: number, end?: number): T[]

getSource

  • Get the underlying collection being filtered.

    Returns ObservableCollection<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

refresh

  • refresh(): void
  • Refreshes the collection. The collection is rebuilt from scratch. This method should be called whenever the state of the system is changed such that the filter predicate will return a different result than it previously did.

    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

setFilter

  • setFilter(filter: function): void
  • Set the function that filters what elements of the source collection will be exposed. Set to null for no filtering. This function will be called a lot so performance matters.

    Parameters

    • filter: function
        • (input: T): boolean
        • Parameters

          • input: T

          Returns boolean

    Returns void

setSource

  • Set the collection that will be exposed as filtered. Set to null for none. The current filter function will be applied.

    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