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

Package | flexlib.controls
Class | public class ConvertibleTreeList
Inheritance | ConvertibleTreeList mx.containers.Canvas

A control that combines the functionality of the Tree component and the List component. <p>The ConvertibleTreeList allows you to use one control and have it display the dataProvider either as a Tree or as a List. You only have to set the dataProvider once. You can set the <codeph>mode</codeph> at any time to change the display mode.</p>

See also

mx.controls.List
mx.controls.Tree

Public Properties

| Property | Defined By
--- | --- | ---
|  | allowMultipleSelection : Boolean | ConvertibleTreeList
|  | dataProvider : Object | ConvertibleTreeList
|  | iconField : String The name of the field in the data provider object that determines what to display as the icon. | ConvertibleTreeList
|  | labelField : String The name of the field in the data provider items to display as the label. | ConvertibleTreeList
|  | list : List [read-only] The List control that is displayed when the mode is set to FULL_LIST, TEXT_LIST, or ICON_LIST. | ConvertibleTreeList
|  | listField : String The name of the attribute that is used to check if an item in the dataProdiver should be included in the List control. | ConvertibleTreeList
|  | mode : String The display mode for the ConvertibleTreeList control. | ConvertibleTreeList
|  | selectedIndex : Object [read-only] | ConvertibleTreeList
|  | selectedItem : Object | ConvertibleTreeList
|  | selectedItems : Array | ConvertibleTreeList
|  | showRoot : Boolean | ConvertibleTreeList
|  | tree : Tree [read-only] The Tree control that is displayed when the mode is set to ConvertibleTreeList.TREE | ConvertibleTreeList

Public Methods

| Method | Defined By
--- | --- | ---
|  | ConvertibleTreeList() | ConvertibleTreeList

Protected Methods

| Method | Defined By
--- | --- | ---
|  | createChildren():void [override] | ConvertibleTreeList
|  | updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void [override] | ConvertibleTreeList

Events

| Event | Summary | Defined By
--- | --- | --- | ---
|  | change | Dispatched when the selectedIndex or selectedItem property changes as a result of user interaction. | ConvertibleTreeList

Public Constants

| Constant | Defined By
--- | --- | ---
|  | FULL_LIST : String = list [static] If mode is set to FULL_LIST then the List control is used for display and both icons and labels are shown. | ConvertibleTreeList
|  | ICON_LIST : String = icon [static] If mode is set to ICON_LIST then the List control is used for display and only icons are shown. | ConvertibleTreeList
|  | TEXT_LIST : String = text [static] If mode is set to TEXT_LIST then the List control is used for display and only labels are shown. | ConvertibleTreeList
|  | TREE : String = tree [static] If mode is set to TREE then the Tree control is used for display. | ConvertibleTreeList

Property Detail

allowMultipleSelection | property

`allowMultipleSelection:Boolean`

Implementation
`public function get allowMultipleSelection():Boolean`
`public function set allowMultipleSelection(value:Boolean):void`

dataProvider | property |

`dataProvider:Object`

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

iconField | property |

`iconField:String`

The name of the field in the data provider object that determines what to display as the icon. By default, the list class does not try to display icons with the text in the rows. However, by specifying an icon field, you can specify a graphic that is created and displayed as an icon in the row. This property is ignored by DataGrid. <p>The renderers will look in the data provider object for a property of the name supplied as the iconField. If the value of the property is a Class, it will instantiate that class and expect it to be an instance of an IFlexDisplayObject. If the value of the property is a String, it will look to see if a Class exists with that name in the application, and if it can't find one, it will also look for a property on the document with that name and expect that property to map to a Class.</p>

The default value is `null`.

Implementation
`public function get iconField():String`
`public function set iconField(value:String):void`

See also

mx.controls.listClasses.ListBase

labelField | property |

`labelField:String`

The name of the field in the data provider items to display as the label. By default the list looks for a property named <codeph>label</codeph> on each item and displays it. However, if the data objects do not contain a <codeph>label</codeph> property, you can set the <codeph>labelField</codeph> property to use a different property in the data object. An example would be "FullName" when viewing a set of people names fetched from a database.

The default value is `"label"`.

Implementation
`public function get labelField():String`
`public function set labelField(value:String):void`

See also

mx.controls.listClasses.ListBase

list | property |

`list:List` [read-only]

The List control that is displayed when the <codeph>mode</codeph> is set to <codeph>FULL_LIST</codeph>, <codeph>TEXT_LIST</codeph>, or <codeph>ICON_LIST</codeph>.

Implementation
`public function get list():List`

listField | property |

`listField:String`

The name of the attribute that is used to check if an item in the dataProdiver should be included in the List control. The XML entry in the dataProvider should be something like: <codeph><entry showInList='true' label='Item' /></codeph>, where you could set showInList to be false if you wanted the item to show up when this component is in Tree mode, but not in List mode.

The default value is `"showInList"`.

Implementation
`public function get listField():String`
`public function set listField(value:String):void`

mode | property |

`mode:String`

The display mode for the ConvertibleTreeList control. <p>Must be one of the static variables of ConvertibleTreeList, either TREE, FULL_LIST, TEXT_LIST, or ICON_LIST.</p>

Implementation
`public function get mode():String`
`public function set mode(value:String):void`

selectedIndex | property |

`selectedIndex:Object` [read-only]

Implementation
`public function get selectedIndex():Object`

selectedItem | property |

`selectedItem:Object`

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

selectedItems | property |

`selectedItems:Array`

Implementation
`public function get selectedItems():Array`
`public function set selectedItems(value:Array):void`

showRoot | property |

`showRoot:Boolean`

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

tree | property |

`tree:Tree` [read-only]

The Tree control that is displayed when the <codeph>mode</codeph> is set to <codeph>ConvertibleTreeList.TREE</codeph>

Implementation
`public function get tree():Tree`
Constructor Detail

ConvertibleTreeList | () | Constructor

`public function ConvertibleTreeList()`

Method Detail

createChildren | () | method

`override protected function createChildren():void`

updateDisplayList | () | method |

`override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void`

Parameters

| `unscaledWidth:Number`
| `unscaledHeight:Number`

Event Detail

change | Event

Event Object Type: `mx.events.ListEvent`
ListEvent.type property = `mx.events.ListEvent.CHANGE`

Dispatched when the <codeph>selectedIndex</codeph> or <codeph>selectedItem</codeph> property changes as a result of user interaction.

Constant Detail

FULL_LIST | Constant

`public static const FULL_LIST:String = list`

If mode is set to FULL_LIST then the List control is used for display and both icons and labels are shown.

ICON_LIST | Constant |

`public static const ICON_LIST:String = icon`

If mode is set to ICON_LIST then the List control is used for display and only icons are shown.

TEXT_LIST | Constant |

`public static const TEXT_LIST:String = text`

If mode is set to TEXT_LIST then the List control is used for display and only labels are shown.

TREE | Constant |

`public static const TREE:String = tree`

If mode is set to TREE then the Tree control is used for display.

Mercredi Juillet 6 2011, 09:45 PM +02:00