Referencia de ActionScript® 3.0 para la plataforma de Adobe® Flash®
Inicio  |  Ocultar lista de paquetes y clases |  Paquetes  |  Clases  |  Novedades  |  Índice  |  Apéndices  |  ¿Por qué hay texto en inglés?
Filtros: Recuperando datos del servidor...
Recuperando datos del servidor...
mx.collections 

HierarchicalCollectionView  - AS3 Flex

Paquetemx.collections
Clasepublic class HierarchicalCollectionView
HerenciaHierarchicalCollectionView Inheritance EventDispatcher Inheritance Object
Implementa IHierarchicalCollectionView, IXMLNotifiable

Versión del lenguaje: ActionScript 3.0
Versión de producto: Flex 3
Versiones de motor de ejecución: Flash Player 9, AIR 1.1

The HierarchicalCollectionView class provides a hierarchical view of a standard collection.

Sintaxis MXMLexpandedOcultar sintaxis MXML
The <mx.HierarchicalCollectionView> inherits all the tag attributes of its superclass, and defines the following tag attributes:

  <mx:HierarchicalCollectionView
  Properties 
    showRoot="true|false"
    source="No default"
  />
  


Propiedades públicas
 PropiedadDefinido por
 Inheritedconstructor : Object
Una referencia a la clase de objeto o función constructora para una instancia de objeto determinada.
Object
  hasRoot : Boolean
[solo lectura] A flag that, if true, indicates that the current data provider has a root node; for example, a single top-level node in a hierarchical structure.
HierarchicalCollectionView
  length : int
[solo lectura] The length of the currently parsed collection.
HierarchicalCollectionView
  openNodes : Object
An Array of Objects containing the data provider element for all the open branch nodes of the data.
HierarchicalCollectionView
  showRoot : Boolean
A Boolean flag that specifies whether to display the data provider's root node.
HierarchicalCollectionView
  source : IHierarchicalData
The source data of the IHierarchicalCollectionView.
HierarchicalCollectionView
Métodos públicos
 MétodoDefinido por
  
HierarchicalCollectionView(hierarchicalData:IHierarchicalData = null, argOpenNodes:Object = null)
Constructor.
HierarchicalCollectionView
  
addChild(parent:Object, newChild:Object):Boolean
Adds a child node to a node of the data.
HierarchicalCollectionView
  
addChildAt(parent:Object, newChild:Object, index:int):Boolean
Add a child node to a node at the specified index.
HierarchicalCollectionView
 Inherited
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
Registra un objeto de detector de eventos con un objeto EventDispatcher, de modo que el detector reciba la notificación de un evento.
EventDispatcher
  
Closes a node to hide its children.
HierarchicalCollectionView
  
Checks the collection for the data item using standard equality test.
HierarchicalCollectionView
  
Returns a new instance of a view iterator over the items in this view.
HierarchicalCollectionView
 Inherited
Distribuye un evento en el flujo del evento.
EventDispatcher
  
Returns a collection of children, if they exist.
HierarchicalCollectionView
  
Returns the depth of the node in the collection.
HierarchicalCollectionView
  
Returns the parent of a node.
HierarchicalCollectionView
 Inherited
Comprueba si el objeto EventDispatcher tiene detectores registrados para un tipo concreto de evento.
EventDispatcher
 Inherited
Indica si un objeto tiene definida una propiedad especificada.
Object
 Inherited
Indica si hay una instancia de la clase Object en la cadena de prototipo del objeto especificado como parámetro.
Object
  
Opens a node to display its children.
HierarchicalCollectionView
 Inherited
Indica si existe la propiedad especificada y si es enumerable.
Object
  
Applies the sort and filter to the view.
HierarchicalCollectionView
  
Removes the child node from the parent node.
HierarchicalCollectionView
  
Removes the child node from a node at the specified index.
HierarchicalCollectionView
 Inherited
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
Elimina un detector del objeto EventDispatcher.
EventDispatcher
 Inherited
Establece la disponibilidad de una propiedad dinámica para operaciones de bucle.
Object
 Inherited
Devuelve la representación de cadena de este objeto, con formato según las convenciones específicas de configuración regional.
Object
 Inherited
Devuelve la representación de cadena del objeto especificado.
Object
 Inherited
Devuelve el valor simple del objeto especificado.
Object
 Inherited
Comprueba si hay registrado un detector de eventos con este objeto EventDispatcher o con cualquiera de sus ascendientes para el tipo de evento concreto.
EventDispatcher
Eventos
 Evento Resumen Definido por
 Inherited[evento broadcast] Se distribuye cuando Flash Player o AIR pasan a estar activos.EventDispatcher
 Inherited[evento broadcast] Se distribuye cuando Flash Player o de AIR pasan a estar inactivos.EventDispatcher
Información sobre propiedades

hasRoot

propiedad
hasRoot:Boolean  [solo lectura]

Versión del lenguaje: ActionScript 3.0
Versión de producto: Flex 3
Versiones de motor de ejecución: Flash Player 9, AIR 1.1

A flag that, if true, indicates that the current data provider has a root node; for example, a single top-level node in a hierarchical structure. XML and Object are examples of data types that have a root node, while Lists and Arrays do not.



Implementación
    public function get hasRoot():Boolean

length

propiedad 
length:int  [solo lectura]

Versión del lenguaje: ActionScript 3.0
Versión de producto: Flex 3
Versiones de motor de ejecución: Flash Player 9, AIR 1.1

The length of the currently parsed collection.



Implementación
    public function get length():int

openNodes

propiedad 
openNodes:Object

Versión del lenguaje: ActionScript 3.0
Versión de producto: Flex 3
Versiones de motor de ejecución: Flash Player 9, AIR 1.1

An Array of Objects containing the data provider element for all the open branch nodes of the data.



Implementación
    public function get openNodes():Object
    public function set openNodes(value:Object):void

showRoot

propiedad 
showRoot:Boolean

Versión del lenguaje: ActionScript 3.0
Versión de producto: Flex 3
Versiones de motor de ejecución: Flash Player 9, AIR 1.1

A Boolean flag that specifies whether to display the data provider's root node. If the source data has a root node, and this property is set to false, the collection will not include the root item. Only the descendants of the root item will be included in the collection.

This property has no effect on a source with no root node, such as List and Array objects.

El valor predeterminado es true.

Esta propiedad se puede utilizar como origen para la vinculación de datos. Cuando se modifica esta propiedad, distribuye el evento propertyChange .



Implementación
    public function get showRoot():Boolean
    public function set showRoot(value:Boolean):void

source

propiedad 
source:IHierarchicalData

Versión del lenguaje: ActionScript 3.0
Versión de producto: Flex 3
Versiones de motor de ejecución: Flash Player 9, AIR 1.1

The source data of the IHierarchicalCollectionView.



Implementación
    public function get source():IHierarchicalData
    public function set source(value:IHierarchicalData):void
Información sobre constructores

HierarchicalCollectionView

()Información sobre
public function HierarchicalCollectionView(hierarchicalData:IHierarchicalData = null, argOpenNodes:Object = null)

Versión del lenguaje: ActionScript 3.0
Versión de producto: Flex 3
Versiones de motor de ejecución: Flash Player 9, AIR 1.1

Constructor.

Parámetros
hierarchicalData:IHierarchicalData (default = null) — The data structure containing the hierarchical data.
 
argOpenNodes:Object (default = null) — The Object that defines a node to appear as open.
Información sobre métodos

addChild

()método
public function addChild(parent:Object, newChild:Object):Boolean

Versión del lenguaje: ActionScript 3.0
Versión de producto: Flex 3
Versiones de motor de ejecución: Flash Player 9, AIR 1.1

Adds a child node to a node of the data.

Parámetros

parent:Object — The Object that defines the parent node.
 
newChild:Object — The Object that defines the new node.

Valor devuelto
Booleantrue if the node is added successfully.

addChildAt

()método 
public function addChildAt(parent:Object, newChild:Object, index:int):Boolean

Versión del lenguaje: ActionScript 3.0
Versión de producto: Flex 3
Versiones de motor de ejecución: Flash Player 9, AIR 1.1

Add a child node to a node at the specified index. This implementation does the following:

  • If the parent is null or undefined, inserts the child at the specified index in the collection specified by source.
  • If the parent has a children field or property, the method adds the child to it at the index location. In this case, the source is not required.
  • If the parent does not have a children field or property, the method adds the children to the parent. The method then adds the child to the parent at the index location. In this case, the source is not required.
  • If the index value is greater than the collection length or number of children in the parent, adds the object as the last child.

Parámetros

parent:Object — The Object that defines the parent node.
 
newChild:Object — The Object that defines the child node.
 
index:int — The 0-based index of where to insert the child node.

Valor devuelto
Booleantrue if the child is added successfully.

closeNode

()método 
public function closeNode(node:Object):void

Versión del lenguaje: ActionScript 3.0
Versión de producto: Flex 3
Versiones de motor de ejecución: Flash Player 9, AIR 1.1

Closes a node to hide its children.

Parámetros

node:Object — The Object that defines the node.

contains

()método 
public function contains(item:Object):Boolean

Versión del lenguaje: ActionScript 3.0
Versión de producto: Flex 3
Versiones de motor de ejecución: Flash Player 9, AIR 1.1

Checks the collection for the data item using standard equality test.

Parámetros

item:Object — The Object that defines the node to look for.

Valor devuelto
Booleantrue if the data item is in the collection, and false if not.

createCursor

()método 
public function createCursor():IViewCursor

Versión del lenguaje: ActionScript 3.0
Versión de producto: Flex 3
Versiones de motor de ejecución: Flash Player 9, AIR 1.1

Returns a new instance of a view iterator over the items in this view.

Valor devuelto
IViewCursor — IViewCursor instance.

Elementos de API relacionados

mx.utils.IViewCursor

getChildren

()método 
public function getChildren(node:Object):ICollectionView

Versión del lenguaje: ActionScript 3.0
Versión de producto: Flex 3
Versiones de motor de ejecución: Flash Player 9, AIR 1.1

Returns a collection of children, if they exist.

Parámetros

node:Object — The Object that defines the node. If null, return a collection of top level nodes.

Valor devuelto
ICollectionView — ICollectionView instance containing the child nodes.

getNodeDepth

()método 
public function getNodeDepth(node:Object):int

Versión del lenguaje: ActionScript 3.0
Versión de producto: Flex 3
Versiones de motor de ejecución: Flash Player 9, AIR 1.1

Returns the depth of the node in the collection.

Parámetros

node:Object — The Object that defines the node.

Valor devuelto
int — The depth of the node.

getParentItem

()método 
public function getParentItem(node:Object):*

Versión del lenguaje: ActionScript 3.0
Versión de producto: Flex 3
Versiones de motor de ejecución: Flash Player 9, AIR 1.1

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

Parámetros

node:Object — The Object that defines the node.

Valor devuelto
* — The parent node containing the node, null for a top-level node, and undefined if the parent cannot be determined.

openNode

()método 
public function openNode(node:Object):void

Versión del lenguaje: ActionScript 3.0
Versión de producto: Flex 3
Versiones de motor de ejecución: Flash Player 9, AIR 1.1

Opens a node to display its children.

Parámetros

node:Object — The Object that defines the node.

refresh

()método 
public function refresh():Boolean

Versión del lenguaje: ActionScript 3.0
Versión de producto: Flex 3
Versiones de motor de ejecución: Flash Player 9, AIR 1.1

Applies the sort and filter to the view. The ICollectionView does not detect changes to a sort or filter automatically, so you must call the refresh() method to update the view after setting the sort or filterFunction property. If your ICollectionView implementation also implements the IMXMLObject interface, you should to call the refresh() method from your initialized() method.

Returns true if the refresh was successful and false if the sort is not yet complete (e.g., items are still pending). A client of the view should wait for a CollectionEvent event with the CollectionEventKind.REFRESH kind property to ensure that the refresh() operation is complete.

Valor devuelto
Booleantrue if the refresh() was complete, false if the refresh() is incomplete.

removeChild

()método 
public function removeChild(parent:Object, child:Object):Boolean

Versión del lenguaje: ActionScript 3.0
Versión de producto: Flex 3
Versiones de motor de ejecución: Flash Player 9, AIR 1.1

Removes the child node from the parent node.

Parámetros

parent:Object — The Object that defines the parent node, and null for top-level nodes.
 
child:Object — The Object that defines the child node to be removed.

Valor devuelto
Booleantrue if the node is removed successfully.

removeChildAt

()método 
public function removeChildAt(parent:Object, index:int):Boolean

Versión del lenguaje: ActionScript 3.0
Versión de producto: Flex 3
Versiones de motor de ejecución: Flash Player 9, AIR 1.1

Removes the child node from a node at the specified index.

Parámetros

parent:Object — The Object that defines the parent node.
 
index:int — The 0-based index of the child node to remove relative to the parent.

Valor devuelto
Booleantrue if the child is removed successfully.




[ X ]¿Por qué hay texto en inglés?
Cierto contenido de la Referencia de ActionScript 3.0 se muestra en inglés

No todo el contenido de la Referencia de ActionScript 3.0 se traduce a todos los idiomas. Si un elemento del lenguaje no se traduce, aparecerá en inglés. Por ejemplo, la clase ga.controls.HelpBox no está traducida en ningún idioma. Por lo tanto, en la versión en español de la referencia, la clase ga.controls.HelpBox aparecerá en inglés.