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 IHierarchicalCollection.updateItem() is called.

feathers.events.HierarchicalCollectionEvent.UPDATE_ALL

Dispatched when IHierarchicalCollection.updateAll() is called.

feathers.events.HierarchicalCollectionEvent.FILTER_CHANGE

Dispatched when IHierarchicalCollection.filterFunction is changed.

feathers.events.HierarchicalCollectionEvent.SORT_CHANGE

Dispatched when IHierarchicalCollection.sortCompareFunction is changed.

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

@:bindable("reset")array: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

.

@:bindable("filterChange")filterFunction:T ‑> Bool

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

.

@:bindable("sortChange")sortCompareFunction:(T, T) ‑> Int

Methods