flexlib :: library Documentation | All Packages | All Classes | Index | Frames No Frames |
TreeGrid

Package | flexlib.controls
Class | public class TreeGrid
Inheritance | TreeGrid mx.controls.DataGrid

Default MXML Property `dataProvider`

Public Properties

| Property | Defined 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

| Method | Defined By
--- | --- | ---
|  | TreeGrid() | TreeGrid
|  | closeAllItems():void | 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

| Method | Defined By
--- | --- | ---
|  | commitProperties():void [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

dataDescriptor | property

`dataDescriptor:ITreeDataDescriptor`

Implementation
`public function get dataDescriptor():ITreeDataDescriptor`
`public function set dataDescriptor(value:ITreeDataDescriptor):void`

dataProvider | property |

`dataProvider:Object`[override]

Implementation
`public function get dataProvider():Object`
`public function set dataProvider(value:Object):void`

hasRoot | property |

`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

showRoot

itemIcons | property |

`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: <pre> {iconID: <i>Class</i>, iconID2: <i>Class</i>} </pre> The <codeph>iconID</codeph> field value is the class of the icon for a closed or leaf item and the <codeph>iconID2</codeph> is the class of the icon for an open item. <p>This property is intended to allow initialization of item icons. Changes to this array after initialization are not detected automatically. Use the <codeph>setItemIcon()</codeph> method to change icons dynamically.</p>

The default value is `undefined`.

See also

setItemIcon()

openItems | property |

`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`

showRoot | property |

`showRoot:Boolean`

Sets the visibility of the root item. If the dataProvider data has a root node, and this is set to <codeph>false</codeph>, 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

hasRoot
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 <codeph>iconField</codeph> and <codeph>iconFunction</codeph> properties for this item if it is a leaf item. Branch items don't use the <codeph>iconField</codeph> and <codeph>iconFunction</codeph> properties. They use the <codeph>folderOpenIcon</codeph> and <codeph>folderClosedIcon</codeph> 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.

Dimanche Juin 19 2011, 03:12 PM +02:00