Options
All
  • Public
  • Public/Protected
  • All
Menu

A collection of child items belonging to a node in the layer list.

Hierarchy

Index

Constructors

constructor

Properties

bindingEvent

bindingEvent: GeocortexEvent

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

layerList

layerList: LayerList

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

  • Adds an item to the collection. Overriding base class method so parent can automatically be set while inserting

    Parameters

    Returns void

addItems

  • Adds multiple items to the collection. Overriding base class method so parent can automatically be set while inserting

    Parameters

    Returns 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
  • Clears the collection after first setting the parents to null

    Returns void

contains

equals

get

getAt

getItems

getLength

  • getLength(): number

getRange

  • Returns items, given a specific range. Works like Array.slice, except end is inclusive.

    Parameters

    • begin: number

      The beginning of the range to fetch.

    • Optional end: number

      The end of the rang to fetch (inclusive).

    Returns LayerListItem[]

indexOf

  • Determines the index of the specified item in the collection.

    Parameters

    Returns number

insertItem

  • Inserts an item into the collection at the specified index. Overriding base class method so parent can be automatically set while inserting

    Parameters

    Returns void

insertItems

  • Inserts multiple item into the collection at the specified index. Overriding base class method so parent can be automatically set while inserting

    Parameters

    Returns void

isEmpty

  • isEmpty(): boolean
  • Checks whether this collection contains any items

    Returns 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(position: number): void
  • Remove item by index. Overriding base class method so parent can automatically be set to null on removal

    Parameters

    • position: number

    Returns void

removeItem

  • Remove item by reference. Overriding base class method so parent can automatically be set to null on removal

    Parameters

    Returns void

removeRange

  • removeRange(from: number, to?: number): void
  • Removes a range of items from the collection. Overriding base class method so parent can automatically be set to null on removal

    Parameters

    • from: number
    • Optional to: number

    Returns 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

set

  • Copies an existing raw collection.

    Parameters

    Returns void

sync

  • Synchronizes one observable collection with another. Henceforth, whenever the source changes, the synchronized collection will also be updated.

    Parameters

    Returns void

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

validateAndAddItem

  • Adds an item after performing validation. Returns true if successful, false otherwise.

    Parameters

    Returns boolean

validateAndAddItems

  • Adds multiple items after validating all of them. Will either add all or none. Returns true on success, false otherwise.

    Parameters

    Returns boolean

validateAndInsertItem

  • validateAndInsertItem(position: number, newItem: LayerListItem): boolean
  • Inserts an item into the collection at a specified index if the item passes validation.

    Parameters

    Returns boolean

validateAndInsertItems

  • validateAndInsertItems(position: number, items: LayerListItem[]): boolean
  • Validates and inserts multiple items into the collection at a specified index. Will either insert all if validated, or none at all.

    Parameters

    Returns boolean