Packageflexlib.controls
Classpublic class TreeGrid
InheritanceTreeGrid Inheritance mx.controls.DataGrid

Default MXML PropertydataProvider



Public Properties
 PropertyDefined By
  dataDescriptor : ITreeDataDescriptor
TreeGrid
  dataProvider : Object
[override]
TreeGrid
  hasRoot : Boolean
[read-only] Indicates that the current dataProvider has a root item; for example, a single top node in a hierarchical structure.
TreeGrid
  itemIcons : Object
An object that specifies the icons for the items.
TreeGrid
  openItems : Object
The items that have been opened or set opened.
TreeGrid
  showRoot : Boolean
Sets the visibility of the root item.
TreeGrid
Public Methods
 MethodDefined By
  
TreeGrid
  
TreeGrid
  
closeItemAt(rowNum:Number, item:Object = null, closeItem:Boolean = true):void
TreeGrid
  
dispatchTreeEvent(type:String, listData:TreeGridListData, renderer:IListItemRenderer, trigger:Event = null, opening:Boolean = true, dispatch:Boolean = true):void
TreeGrid
  
isBranch(item:Object):Boolean
TreeGrid
  
isItemOpen(item:Object):Boolean
TreeGrid
  
openItemAt(rowNum:Number, item:Object = null):Number
TreeGrid
  
setItemIcon(item:Object, iconID:Class, iconID2:Class):void
Sets the associated icon for the item.
TreeGrid
Protected Methods
 MethodDefined By
  
[override]
TreeGrid
  
getItemDepth(item:Object, offset:int):int
TreeGrid
  
initListData(item:Object, treeListData:TreeGridListData):void
TreeGrid
  
isLastItem(listData:TreeGridListData):Boolean
This method find if the current node is the last displayed sibling Used to draw the vertical trunk lines, if it is the last child then the vertical trunk line should stop in the middle of the row
TreeGrid
  
makeListData(data:Object, uid:String, rowNum:int, columnNum:int, column:DataGridColumn):BaseListData
[override]
TreeGrid
  
rootModelChangeHandler(event:CollectionEvent):void
TreeGrid
Styles
 Style Description Defined By
  
defaultLeafIcon
Type: Class Format: EmbeddedFile CSS Inheritance: no
TreeGrid
  
disclosureClosedIcon
Type: Class Format: EmbeddedFile CSS Inheritance: no
TreeGrid
  
disclosureOpenIcon
Type: Class Format: EmbeddedFile CSS Inheritance: no
TreeGrid
  
folderClosedIcon
Type: Class Format: EmbeddedFile CSS Inheritance: no
TreeGrid
  
folderOpenIcon
Type: Class Format: EmbeddedFile CSS Inheritance: no
TreeGrid
  
indentation
Type: Number CSS Inheritance: no
TreeGrid
  
trunkColor
Type: uint Format: Color CSS Inheritance: yes
TreeGrid
  
verticalTrunks
Type: String CSS Inheritance: no
TreeGrid
Property Detail
dataDescriptorproperty
dataDescriptor:ITreeDataDescriptor


Implementation
    public function get dataDescriptor():ITreeDataDescriptor
    public function set dataDescriptor(value:ITreeDataDescriptor):void
dataProviderproperty 
dataProvider:Object[override]


Implementation
    public function get dataProvider():Object
    public function set dataProvider(value:Object):void
hasRootproperty 
hasRoot:Boolean  [read-only]

Indicates that the current dataProvider has a root item; for example, a single top node in a hierarchical structure. XML and Object are examples of types that have a root. Lists and arrays do not.


Implementation
    public function get hasRoot():Boolean

See also

itemIconsproperty 
public var itemIcons:Object

An object that specifies the icons for the items. Each entry in the object has a field name that is the item UID and a value that is an an object with the following format:

      {iconID: Class, iconID2: Class}
      
The iconID field value is the class of the icon for a closed or leaf item and the iconID2 is the class of the icon for an open item.

This property is intended to allow initialization of item icons. Changes to this array after initialization are not detected automatically. Use the setItemIcon() method to change icons dynamically.

The default value is undefined.

See also

openItemsproperty 
openItems:Object

The items that have been opened or set opened.

The default value is null.


Implementation
    public function get openItems():Object
    public function set openItems(value:Object):void
showRootproperty 
showRoot:Boolean

Sets the visibility of the root item. If the dataProvider data has a root node, and this is set to false, the Tree control does not display the root item. Only the decendants of the root item are displayed. This flag has no effect on non-rooted dataProviders, such as List and Array.

The default value is true.


Implementation
    public function get showRoot():Boolean
    public function set showRoot(value:Boolean):void

See also

Constructor Detail
TreeGrid()Constructor
public function TreeGrid()



Method Detail
closeAllItems()method
public function closeAllItems():void

closeItemAt()method 
public function closeItemAt(rowNum:Number, item:Object = null, closeItem:Boolean = true):void

Parameters

rowNum:Number
 
item:Object (default = null)
 
closeItem:Boolean (default = true)

commitProperties()method 
override protected function commitProperties():void

dispatchTreeEvent()method 
public function dispatchTreeEvent(type:String, listData:TreeGridListData, renderer:IListItemRenderer, trigger:Event = null, opening:Boolean = true, dispatch:Boolean = true):void

Parameters

type:String
 
listData:TreeGridListData
 
renderer:IListItemRenderer
 
trigger:Event (default = null)
 
opening:Boolean (default = true)
 
dispatch:Boolean (default = true)

getItemDepth()method 
protected function getItemDepth(item:Object, offset:int):int

Parameters

item:Object
 
offset:int

Returns
int
initListData()method 
protected function initListData(item:Object, treeListData:TreeGridListData):void

Parameters

item:Object
 
treeListData:TreeGridListData

isBranch()method 
public function isBranch(item:Object):Boolean

Parameters

item:Object

Returns
Boolean
isItemOpen()method 
public function isItemOpen(item:Object):Boolean

Parameters

item:Object

Returns
Boolean
isLastItem()method 
protected function isLastItem(listData:TreeGridListData):Boolean

This method find if the current node is the last displayed sibling Used to draw the vertical trunk lines, if it is the last child then the vertical trunk line should stop in the middle of the row

Parameters

listData:TreeGridListData

Returns
Boolean
makeListData()method 
override protected function makeListData(data:Object, uid:String, rowNum:int, columnNum:int, column:DataGridColumn):BaseListData

Parameters

data:Object
 
uid:String
 
rowNum:int
 
columnNum:int
 
column:DataGridColumn

Returns
BaseListData
openItemAt()method 
public function openItemAt(rowNum:Number, item:Object = null):Number

Parameters

rowNum:Number
 
item:Object (default = null)

Returns
Number — the number of rows added to the display model
rootModelChangeHandler()method 
protected function rootModelChangeHandler(event:CollectionEvent):void

Parameters

event:CollectionEvent

setItemIcon()method 
public function setItemIcon(item:Object, iconID:Class, iconID2:Class):void

Sets the associated icon for the item. Calling this method overrides the iconField and iconFunction properties for this item if it is a leaf item. Branch items don't use the iconField and iconFunction properties. They use the folderOpenIcon and folderClosedIcon properties.

Parameters

item:Object — Item to affect.
 
iconID:Class — Linkage ID for the closed (or leaf) icon.
 
iconID2:Class — Linkage ID for the open icon.