Packagemx.controls.treeClasses
Interfacepublic interface ITreeDataDescriptor2 extends ITreeDataDescriptor
Implementors DefaultDataDescriptor

Language Version : ActionScript 3.0
Product Version : Flex 3
Runtime Versions : Flash Player 9, AIR 1.1

The ITreeDataDescriptor2 Interface defines methods for parsing and adding nodes to a collection of data that is displayed by a Tree control.

See also

mx.collections.ICollectionView


Public Methods
 MethodDefined By
 Inherited
addChildAt(parent:Object, newChild:Object, index:int, model:Object = null):Boolean
Adds a child node to a node at the specified index.
ITreeDataDescriptor
 Inherited
getChildren(node:Object, model:Object = null):ICollectionView
Provides access to a node's children, returning a collection view of children if they exist.
ITreeDataDescriptor
 Inherited
getData(node:Object, model:Object = null):Object
Gets the data from a node.
ITreeDataDescriptor
  
getHierarchicalCollectionAdaptor(hierarchicalData:ICollectionView, uidFunction:Function, openItems:Object, model:Object = null):ICollectionView
Returns an ICollectionView instance that makes the hierarchical data appear as if it was a linear ICollectionView instance.
ITreeDataDescriptor2
  
getNodeDepth(node:Object, iterator:IViewCursor, model:Object = null):int
Returns the depth of the node, meaning the number of ancestors it has.
ITreeDataDescriptor2
  
getParent(node:Object, collection:ICollectionView, model:Object = null):Object
Returns the parent of the node The parent of a top-level node is null.
ITreeDataDescriptor2
 Inherited
hasChildren(node:Object, model:Object = null):Boolean
Tests for the existence of children in a non-terminating node.
ITreeDataDescriptor
 Inherited
isBranch(node:Object, model:Object = null):Boolean
Tests a node for termination.
ITreeDataDescriptor
 Inherited
removeChildAt(parent:Object, child:Object, index:int, model:Object = null):Boolean
Removes a child node to a node at the specified index.
ITreeDataDescriptor
Method Detail
getHierarchicalCollectionAdaptor()method
public function getHierarchicalCollectionAdaptor(hierarchicalData:ICollectionView, uidFunction:Function, openItems:Object, model:Object = null):ICollectionView

Language Version : ActionScript 3.0
Product Version : Flex 3
Runtime Versions : Flash Player 9, AIR 1.1

Returns an ICollectionView instance that makes the hierarchical data appear as if it was a linear ICollectionView instance.

Parameters

hierarchicalData:ICollectionView — The hierarchical data.
 
uidFunction:Function — A function that takes an Object and returns the UID, as a String. This parameter is usually the Tree.itemToUID() method.
 
openItems:Object — The items that have been opened or set opened.
 
model:Object (default = null) — The collection to which this node belongs.

Returns
ICollectionView — An ICollectionView instance.

See also

getNodeDepth()method 
public function getNodeDepth(node:Object, iterator:IViewCursor, model:Object = null):int

Language Version : ActionScript 3.0
Product Version : Flex 3
Runtime Versions : Flash Player 9, AIR 1.1

Returns the depth of the node, meaning the number of ancestors it has.

Parameters

node:Object — The Object that defines the node.
 
iterator:IViewCursor — An IViewCursor instance that could be used to do the calculation.
 
model:Object (default = null) — The collection to which this node belongs.

Returns
int — The depth of the node, where 0 corresponds to the top level, and -1 if the depth cannot be calculated.
getParent()method 
public function getParent(node:Object, collection:ICollectionView, model:Object = null):Object

Language Version : ActionScript 3.0
Product Version : Flex 3
Runtime Versions : Flash Player 9, AIR 1.1

Returns the parent of the node The parent of a top-level node is null.

Parameters

node:Object — The Object that defines the node.
 
collection:ICollectionView — An ICollectionView instance that could be used to do the calculation.
 
model:Object (default = null) — The collection to which this node belongs.

Returns
Object — The parent node containing the node as child, null for a top-level node, and undefined if the parent cannot be determined.