ArrayChildrenHierarchicalCollectionDataDescriptor
public class
feathers.data.ArrayChildrenHierarchicalCollectionDataDescriptor
Description
A hierarchical data descriptor where children are defined as arrays in a
property defined on each branch. The property name defaults to "children",
but it may be customized.
The basic structure of the data source takes the following form. The root must always be an Array.
[
{
text: "Branch 1",
children:
[
{ text: "Child 1-1" },
{ text: "Child 1-2" }
]
},
{
text: "Branch 2",
children:
[
{ text: "Child 2-1" },
{ text: "Child 2-2" },
{ text: "Child 2-3" }
]
}
]
API overview
Constructor
ArrayChildrenHierarchicalCollectionDataDescriptor
()
Constructor.
Attributes
Public attributes
| childrenField: String |
The field used to access the Array of a branch's children |
Functions
Public functions
| addItemAt ( data: Object , item: Object , index: Number , rest: Vector.<Object> ): Void |
Adds an item to the data source, at the specified location |
| getItemAt ( data: Object , index: Number , rest: Vector.<Object> ): Object |
Returns the item at the specified location in the data source |
| getItemLocation ( data: Object , item: Object , result: Vector.<Number> = null , rest: Vector.<Object> ): Vector.<Number> |
Determines which location the item appears at within the data source |
| getLength ( data: Object , rest: Vector.<Object> ): Number |
The number of items at the specified location in the data source |
| isBranch ( node: Object ): Boolean |
Determines if a node from the data source is a branch |
| removeItemAt ( data: Object , index: Number , rest: Vector.<Object> ): Object |
Removes the item at the specified location from the data source and returns it |
| setItemAt ( data: Object , item: Object , index: Number , rest: Vector.<Object> ): Void |
Replaces the item at the specified location with a new item |
Constructor
ArrayChildrenHierarchicalCollectionDataDescriptor ()
Constructor.
Attributes
Functions
addItemAt ( data: Object , item: Object , index: Number , rest: Vector.<Object> ): Void
Adds an item to the data source, at the specified location.
The rest arguments are the indices that make up the location.
Parameters
| data: Object | |
| item: Object | |
| index: Number | |
| rest: Vector.<Object> |
getFullTypeName
(): String
Inherited from Object
native
Gets the fully qualified type name of the Object. The fully qualified type name includes the package of the type.
Returns
| String | fully qualified type name of the Object. |
getItemAt ( data: Object , index: Number , rest: Vector.<Object> ): Object
Returns the item at the specified location in the data source.
The rest arguments are the indices that make up the location.
Parameters
| data: Object | |
| index: Number | |
| rest: Vector.<Object> |
getItemLocation ( data: Object , item: Object , result: Vector.<Number> = null , rest: Vector.<Object> ): Vector.<Number>
Determines which location the item appears at within the data source.
If the item isn't in the data source, returns an empty Vector.<int>.
The rest arguments are optional indices to narrow
the search.
Parameters
| data: Object | |
| item: Object | |
| result: Vector.<Number> = null | |
| rest: Vector.<Object> |
getLength ( data: Object , rest: Vector.<Object> ): Number
The number of items at the specified location in the data source.
The rest arguments are the indices that make up the location. If a location is omitted, the length returned will be for the root level of the collection.
Parameters
| data: Object | |
| rest: Vector.<Object> |
getType
(): Type
Inherited from Object
native
Gets the Type that describes the Object.
Returns
| Type | The Type that describes the object. |
getTypeName
(): String
Inherited from Object
native
Gets the type name of the Object.
Returns
| String | type name of the Object. |
isBranch ( node: Object ): Boolean
Determines if a node from the data source is a branch.
Parameters
| node: Object |
removeItemAt ( data: Object , index: Number , rest: Vector.<Object> ): Object
Removes the item at the specified location from the data source and returns it.
The rest arguments are the indices that make up the location.
Parameters
| data: Object | |
| index: Number | |
| rest: Vector.<Object> |