| Function |
Defined By |
|
ListCollection(sourceArray)
|
[Constructor] ListCollection
|
Creates new ListCollection instance.
| |
sourceArray : Array
Backing array to be used as the collection's source. This is used if you have an existing array you want to give to the ListCollection to manage. Setting this to null will cause the ListCollection to create its own internal array.
|
|
|
|
addItem(item)
|
ListCollection
|
Adds an item to the end of the collection and dispatches a "collectionchanged" "add" event.
| |
item : Object
The item to add to the collection
|
| |
returns : Object
The item just added to the collection.
|
|
|
|
addItemAt(item, index)
|
ListCollection
|
Adds an item to the collection at the supplied index and dispatches a "collectionchanged" "add" event.
| |
item : Object
The item to add to the collection
|
| |
index : int
The index to insert the item.
|
| |
returns : Object
The item just added to the collection, or null if the index was out of range.
|
|
|
|
clear()
|
ListCollection
|
Clears the collection and dispatches a "collectionchanged" "reset" event.
|
|
|
getCollectionSort()
|
ListCollection
|
Gets the CollectionSort used when calling sort().
| |
returns : CollectionSort
The CollectionSort to be used when calling sort().
|
|
|
|
getItemAt(index)
|
ListCollection
|
Gets an item in the collection at the supplied index.
| |
index : int
The index to which to return the collection item.
|
| |
returns : Object
The collection item or null if the index is out of range.
|
|
|
|
getItemIndex(item)
|
ListCollection
|
Gets the collection index of the item.
| |
item : Object
The item to which to return the collection index.
|
| |
returns : int
The collection index or -1 if the item is not in the collection.
|
|
|
|
getLength()
|
ListCollection
|
Gets the number of elements in the collection.
| |
returns : int
The number of elements in the collection.
|
|
|
|
getSourceArray()
|
ListCollection
|
Gets the source array currently used for the collection.
| |
returns : Array
The source array currently used for the collection.
|
|
|
|
indexUpdated(index)
|
ListCollection
|
Dispatches a "collectionchanged" "update" event. When a data objects internal
data is changed, call this to update the Container such as a DataList or DataGrid.
| |
index : int
The index to dispatch the "update" event.
|
|
|
|
removeItem(item)
|
ListCollection
|
Removes an item from the collection and dispatches a "collectionchanged" "remove" event.
| |
item : Object
The item to remove from the collection.
|
| |
returns : Object
The item just removed from the collection, or null if the item was not in the collection.
|
|
|
|
removeItemAt(index)
|
ListCollection
|
Removes an item from the collection at the supplied index and dispatches a "collectionchanged" "remove" event.
| |
index : int
The index to remove the item.
|
| |
returns : Object
The item just removed to the collection, or null if the index was out of range.
|
|
|
|
replaceItemAt(item, index)
|
ListCollection
|
Replaces an item in the collection at the supplied index and dispatches a "collectionchanged" "update" event.
| |
item : Object
The new item to which replace the existing item.
|
| |
index : int
The index to replace.
|
| |
returns : Object
The item just replaced, or null if the index was out of range.
|
|
|
|
setCollectionSort(collectionSort)
|
ListCollection
|
Sets the CollectionSort to be used when calling sort().
| |
collectionSort : CollectionSort
The CollectionSort to be used when calling sort(). (or null)
|
|
|
|
setSourceArray(sourceArray)
|
ListCollection
|
Sets the source array to be used for the collection and dispatches a "collectionchanged" "reset" event.
| |
sourceArray : Array
The source array to be used for the collection.
|
|
|
|
sort()
|
ListCollection
|
Sorts the collection and dispatches a "collectionchanged" "reset" event.
|
|
| Function |
Defined By |
|
ListCollection(sourceArray)
|
[Constructor] ListCollection
|
Creates new ListCollection instance.
| |
sourceArray : Array
Backing array to be used as the collection's source. This is used if you have an existing array you want to give to the ListCollection to manage. Setting this to null will cause the ListCollection to create its own internal array.
|
|
|
|
addEventListener(type, callback)
|
EventDispatcher
|
Registers an event lister function to be called when an event occurs.
| |
type : String
String representing the event type.
|
| |
callback : Function
Function to be called when the event occurs.
|
|
|
|
addItem(item)
|
ListCollection
|
Adds an item to the end of the collection and dispatches a "collectionchanged" "add" event.
| |
item : Object
The item to add to the collection
|
| |
returns : Object
The item just added to the collection.
|
|
|
|
addItemAt(item, index)
|
ListCollection
|
Adds an item to the collection at the supplied index and dispatches a "collectionchanged" "add" event.
| |
item : Object
The item to add to the collection
|
| |
index : int
The index to insert the item.
|
| |
returns : Object
The item just added to the collection, or null if the index was out of range.
|
|
|
|
clear()
|
ListCollection
|
Clears the collection and dispatches a "collectionchanged" "reset" event.
|
|
|
dispatchEvent(event)
|
EventDispatcher
|
Dispatches an event to be processed by registered event listeners. The Event's target is the
EventDispatcher which called dispatchEvent. The Event will be cloned prior to passing to callback functions
to ensure the callback cannot modify the Event data or properties. You can check if the event was canceled
by calling the Event's getIsCanceled after dispatching it. Re-dispatching the same event will re-set its canceled state to false.
| |
event : DispatcherEvent
The DispatcherEvent class or subclass to be dispatched.
|
|
|
|
getCollectionSort()
|
ListCollection
|
Gets the CollectionSort used when calling sort().
| |
returns : CollectionSort
The CollectionSort to be used when calling sort().
|
|
|
|
getItemAt(index)
|
ListCollection
|
Gets an item in the collection at the supplied index.
| |
index : int
The index to which to return the collection item.
|
| |
returns : Object
The collection item or null if the index is out of range.
|
|
|
|
getItemIndex(item)
|
ListCollection
|
Gets the collection index of the item.
| |
item : Object
The item to which to return the collection index.
|
| |
returns : int
The collection index or -1 if the item is not in the collection.
|
|
|
|
getLength()
|
ListCollection
|
Gets the number of elements in the collection.
| |
returns : int
The number of elements in the collection.
|
|
|
|
getSourceArray()
|
ListCollection
|
Gets the source array currently used for the collection.
| |
returns : Array
The source array currently used for the collection.
|
|
|
|
hasEventListener(type, callback)
|
EventDispatcher
|
Checks if an event listener has been registered with this EventDispatcher
| |
type : String
String representing the event type.
|
| |
callback : Function
Function callback to be called when the event occurs. This may be null to check if the EventDispatcher has any events registered for the provided type.
|
| |
returns : boolean
Returns true if the EventDispatcher has the provided callback registered for the provided type, or any callback for the provided type if the callback parameter is null. Otherwise, returns false.
|
|
|
|
indexUpdated(index)
|
ListCollection
|
Dispatches a "collectionchanged" "update" event. When a data objects internal
data is changed, call this to update the Container such as a DataList or DataGrid.
| |
index : int
The index to dispatch the "update" event.
|
|
|
|
removeEventListener(type, callback)
|
EventDispatcher
|
Removes a callback from the EventDispatcher
| |
type : String
String representing the event type.
|
| |
callback : Function
Function callback to be removed.
|
| |
returns : boolean
Returns true if the callback was successfully removed, otherwise false such as if the function callback was not previously registered.
|
|
|
|
removeItem(item)
|
ListCollection
|
Removes an item from the collection and dispatches a "collectionchanged" "remove" event.
| |
item : Object
The item to remove from the collection.
|
| |
returns : Object
The item just removed from the collection, or null if the item was not in the collection.
|
|
|
|
removeItemAt(index)
|
ListCollection
|
Removes an item from the collection at the supplied index and dispatches a "collectionchanged" "remove" event.
| |
index : int
The index to remove the item.
|
| |
returns : Object
The item just removed to the collection, or null if the index was out of range.
|
|
|
|
replaceItemAt(item, index)
|
ListCollection
|
Replaces an item in the collection at the supplied index and dispatches a "collectionchanged" "update" event.
| |
item : Object
The new item to which replace the existing item.
|
| |
index : int
The index to replace.
|
| |
returns : Object
The item just replaced, or null if the index was out of range.
|
|
|
|
setCollectionSort(collectionSort)
|
ListCollection
|
Sets the CollectionSort to be used when calling sort().
| |
collectionSort : CollectionSort
The CollectionSort to be used when calling sort(). (or null)
|
|
|
|
setSourceArray(sourceArray)
|
ListCollection
|
Sets the source array to be used for the collection and dispatches a "collectionchanged" "reset" event.
| |
sourceArray : Array
The source array to be used for the collection.
|
|
|
|
sort()
|
ListCollection
|
Sorts the collection and dispatches a "collectionchanged" "reset" event.
|
|