Creates a new ObservableCollection, optionally wrapping an existing array.
var collection = new ObservableCollection(["hello"]);
collection.addItem("world");
// Returns ["hello", "world"]
var array = collection.get();
An array of items to initialize the collection to.
The {@link geocortex.framework.events.Event} that is fired when this collection is modified.
An optional throttleDelay parameter that defines the delay between throttling operations (in milliseconds).
An array containing all the throttled binding operations currently active on this collection, if throttling is enabled.
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.
Adds an item to the collection and triggers the binding event.
The item to add to the collection.
Adds items to the collection and triggers the binding event.
The items to add to the collection.
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.
The scope to execute the handler in. This will the meaning of 'this' inside of the handler when it is called.
The handler to execute when the Observable changes.
Clears the collection and triggers the binding event.
Checks whether this collection contains a specific item.
The item to check for.
Gets the raw underlying collection.
Tries to get an item from the underlying collection at a given index.
Gets the raw underlying collection.
Gets the length of the collection.
Returns items, given a specific range. Works like Array.slice, except end is inclusive.
The beginning of the range to fetch.
The end of the rang to fetch (inclusive).
Determines the index of the specified item in the collection.
The item to get the index of.
Inserts an item into the collection at a given position and triggers the binding event.
The location to insert the items.
Inserts items into the collection at a given position and triggers the binding event.
The location to insert the items.
The items to insert.
Checks whether this collection contains any items
Returns the length of this collection.
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.
The scope to execute the handler in.
The handler to execute when the Observable changes.
Fires the binding event twice, simulating a clear and and append of the entire collection back to its original state. See Observable.
Removes the item at the specified index and triggers the binding event. If the index is not valid for this collection, then nothing happens.
The index of the item to remove.
Removes an object from the collection and triggers the binding event.
The object instance to remove.
Removes a range of items from the collection and fires the binding event accordingly.
The index to remove from.
The index to remove to. This is inclusive.
Removes all items from this ObservableCollection where the supplied callback function returns a truthy value.
Copies an existing raw collection.
The raw collection to copy.
Synchronizes one observable collection with another. Henceforth, whenever the source changes, the synchronized collection will also be updated.
The source ObservableCollection that this ObservableCollection will now mirror.
Unbinds a binding subscription, given a valid subscription token received from a call to bind().
The token representing the previously added subscription handler.
ObservableCollection provides Observable semantics around collections. Modifications to an ObservableCollection are broadcast via a binding event that describes the change to the collection via a {@link geocortex.framework.events.CollectionChangedArgs}.
See Observable for more details about semantics and usage of Observables.