class ArrayHierarchicalCollection<T>
package feathers.data
extends EventDispatcher
implements IExternalizable, IHierarchicalCollection<T>
Wraps an Array
data source with a common API for use with UI controls that
support hierarchical data, such as TreeView
or TreeGridView
.
Events:
openfl.events.Event.CHANGE | Dispatched when the collection changes. |
---|---|
feathers.events.HierarchicalCollectionEvent.ADD_ITEM | Dispatched when an item is added to the collection. |
feathers.events.HierarchicalCollectionEvent.REMOVE_ITEM | Dispatched when an item is removed from the collection. |
feathers.events.HierarchicalCollectionEvent.REPLACE_ITEM | Dispatched when an item is replaced in the collection. |
feathers.events.HierarchicalCollectionEvent.REMOVE_ALL | Dispatched when all items are removed from the collection. |
feathers.events.HierarchicalCollectionEvent.RESET | Dispatched when the source of the collection is changed. |
feathers.events.HierarchicalCollectionEvent.UPDATE_ITEM | Dispatched
when |
feathers.events.HierarchicalCollectionEvent.UPDATE_ALL | Dispatched
when |
feathers.events.HierarchicalCollectionEvent.FILTER_CHANGE | Dispatched
when |
feathers.events.HierarchicalCollectionEvent.SORT_CHANGE | Dispatched
when |
1.0.0
.See also:
Constructor
new(?array:Array<T>, ?itemToChildren:T ‑> Array<T>)
Creates a new ArrayHierarchicalCollection
object with the given arguments.
1.0.0
.Variables
array:Array<T>
The Array<T>
data source for this collection.
The following example replaces the data source with a new array:
collection.array = [];
1.0.0
.itemToChildren:T ‑> Array<T>
A function that returns an item's children. If the item is not a branch,
the function should return null
. If the item is a branch, but it
contains no children, the function should return an empty array.
1.0.0
.