Wraps an Array data source with a common API for use with UI controls that support hierarchical data, such as TreeView.

Events:

openfl.events.Event.CHANGE
feathers.events.HierarchicalCollectionEvent.ADD_ITEM
feathers.events.HierarchicalCollectionEvent.REMOVE_ITEM
feathers.events.HierarchicalCollectionEvent.REPLACE_ITEM
feathers.events.HierarchicalCollectionEvent.REMOVE_ALL
feathers.events.HierarchicalCollectionEvent.RESET
feathers.events.HierarchicalCollectionEvent.UPDATE_ITEM
feathers.events.HierarchicalCollectionEvent.UPDATE_ALL
feathers.events.HierarchicalCollectionEvent.FILTER_CHANGE
feathers.events.HierarchicalCollectionEvent.SORT_CHANGE
Available since

1.0.0

.

See also:

Constructor

new(?array:Array<T>, ?itemToChildren:T ‑> Array<T>)

Creates a new ArrayHierarchicalCollection object with the given arguments.

Available since

1.0.0

.

Variables

@:flash.propertyarray:Array<T>

The Array<T> data source for this collection.

The following example replaces the data source with a new array:

collection.array = [];
Available since

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.

Available since

1.0.0

.

Methods