| Package | flexlib.controls |
| Class | public class TreeGrid |
| Inheritance | TreeGrid mx.controls.DataGrid |
Default MXML PropertydataProvider
| 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 | ||
| 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 | ||
| 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 | ||
| dataDescriptor | property |
dataDescriptor:ITreeDataDescriptor public function get dataDescriptor():ITreeDataDescriptor public function set dataDescriptor(value:ITreeDataDescriptor):void| dataProvider | property |
dataProvider:Object[override] 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.
public function get hasRoot():BooleanSee also
| itemIcons | property |
public var itemIcons:ObjectAn 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
| openItems | property |
openItems:ObjectThe items that have been opened or set opened.
The default value is null.
public function get openItems():Object public function set openItems(value:Object):void| showRoot | property |
showRoot:BooleanSets 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.
public function get showRoot():Boolean public function set showRoot(value:Boolean):voidSee also
| TreeGrid | () | Constructor |
public function TreeGrid()| 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):voidParameters
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):intParameters
item:Object | |
offset:int |
int |
| initListData | () | method |
protected function initListData(item:Object, treeListData:TreeGridListData):voidParameters
item:Object | |
treeListData:TreeGridListData |
| isBranch | () | method |
public function isBranch(item:Object):Boolean
Parameters
item:Object |
Boolean |
| isItemOpen | () | method |
public function isItemOpen(item:Object):Boolean
Parameters
item:Object |
Boolean |
| isLastItem | () | method |
protected function isLastItem(listData:TreeGridListData):BooleanThis 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 |
Boolean |
| makeListData | () | method |
override protected function makeListData(data:Object, uid:String, rowNum:int, columnNum:int, column:DataGridColumn):BaseListDataParameters
data:Object | |
uid:String | |
rowNum:int | |
columnNum:int | |
column:DataGridColumn |
BaseListData |
| openItemAt | () | method |
public function openItemAt(rowNum:Number, item:Object = null):Number
Parameters
rowNum:Number | |
item:Object (default = null) |
Number — the number of rows added to the display model
|
| rootModelChangeHandler | () | method |
protected function rootModelChangeHandler(event:CollectionEvent):voidParameters
event:CollectionEvent |
| setItemIcon | () | method |
public function setItemIcon(item:Object, iconID:Class, iconID2:Class):voidSets 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.
|