| Package | nl.flexperiments.tree |
| Class | public class FlpTree |
| Inheritance | FlpTree Node mx.containers.VBox |
FlpTree is a replacement for the default mx:tree. It's more stable because it does not rely on listbased classes. The FlpTree uses VBoxes to build up the tree. For additional information, please see http://labs.flexperiments.nl/ (tags: Tree, component)
Version 2.0 is completely rewritten, using the flex component lifecycle, which should make it faster and more stable, oh, and it's open source now!
| Property | Defined by | ||
|---|---|---|---|
| allowDropOnAllNodes : Boolean
Gets or sets the allowDropOnAllNodes property,
when true, you can drop a node on any node, when false, you can only drop on folders
(nodes having a 'children' property)
| FlpTree | ||
| childrenField : String
Gets or sets the name of the children field of the dataProvider
| FlpTree | ||
| closedfoldericon : *
The default icon for a closed folder
| FlpTree | ||
| closedicon : *
The default icon of the open / close button for a opened folder
| FlpTree | ||
| data : Object [read-only]
| FlpTree | ||
| dataProvider : ArrayCollection
The dataprovider
| FlpTree | ||
| dragEnabled : Boolean
Gets or sets the dragEnabled property,
when enabled, you can drag items to rearrange them
will also set dropenabled to true
| FlpTree | ||
| dropEnabled : Boolean
Gets or sets the dropEnabled property,
when enabled, you can drop items in the tree, but not rearrange items
| FlpTree | ||
| dropIndicator : IFactory
Sets the renderer for the drop thinghy
| FlpTree | ||
| hoverDelayValue : uint [read-only]
| FlpTree | ||
| icon : Class
The default icon for a node
If it's a string, it sets the icon,
if it's an array, it sets the icon and the folder icons
if it's an object, it sets the icon and the folder icons, you can use the following names:
icon - the icon
foldericon - the icon for folders (opened and closed)
openedfoldericon - the icon for opened folder
closedfoldericon - the icon for closed folders
Note: these are the default icons, the tree will look for icons in de dataprovider first.
| FlpTree | ||
| iconField : String
Gets or sets the field of the dataprovider which holds the icons
| FlpTree | ||
| iconFunction : Function
Gets or sets the function to call for the icons
| FlpTree | ||
| indentation : int
Gets or sets the indentation of child nodes
| FlpTree | ||
![]() | itemIcon : *
You can call this function from your renderer to get the correct icon
| Node | |
![]() | itemLabel : String
You can call this function from your renderer to get the correct label
| Node | |
![]() | __itemRenderer : * | Node | |
| itemRenderer : IFactory
The renderer for a node
| FlpTree | ||
| labelField : String
Gets or sets the field of the dataprovider which acts as labelfield
| FlpTree | ||
| labelFunction : Function
Gets or sets the function to call for the labels
| FlpTree | ||
| multiselect : Boolean
Gets or sets the multiple selection allowance
| FlpTree | ||
![]() | open : Boolean | Node | |
| openedfoldericon : *
The default icon for a opened folder
| FlpTree | ||
| openedicon : *
The default icon of the open / close button for a opened folder
| FlpTree | ||
| openNodeOnHover : Boolean
Gets or sets the openNodeOnHover property,
when true, a node will open when you drag a node over it
(nodes having a 'children' property)
| FlpTree | ||
![]() | parentNode : Node
Returns the parent node
| Node | |
| rollOverColorValue : uint [read-only]
| FlpTree | ||
![]() | selected : Boolean
Selects or deselects the node.
| Node | |
| selectedNode : Node
Gets or sets the selected node
| FlpTree | ||
| selectedNodes : Array
Gets the selected nodes
| FlpTree | ||
| selectionColorValue : uint [read-only]
| FlpTree | ||
| textRollOverColorValue : uint [read-only]
| FlpTree | ||
| textSelectedColorValue : uint [read-only]
| FlpTree | ||
![]() | tree : FlpTree | Node | |
| verticalGapValue : int [read-only]
Gets the gap between nodes
| FlpTree | ||
| Method | Defined by | ||
|---|---|---|---|
|
FlpTree()
| FlpTree | ||
|
__dispatchTreeEvent(eventType:String, data:Object):void
| FlpTree | ||
![]() |
dispose():void
| Node | |
|
Finds nodes with the given property and it's value.
| FlpTree | ||
![]() |
refresh(recursive:Boolean = true):void
| Node | |
| Method | Defined by | ||
|---|---|---|---|
![]() |
_dragBoxEnterHandler(event:DragEvent):void
Gets called when dragging over the childrenBox
| Node | |
![]() |
_dragEnterHandler(event:DragEvent):void
This method is called when the user drags a node over (the renderer of) this node
| Node | |
![]() | Node | ||
|
commitProperties():void
| FlpTree | ||
![]() |
createChildren():void
| Node | |
![]() |
disposeChildren():void
| Node | |
![]() |
forceCommit():void
| Node | |
![]() |
removeNode(index:Number):void
| Node | |
| Event | Summary | Defined by | ||
|---|---|---|---|---|
| Dispatched when the user closes a node The TreeEvent contains a data property with additional information | FlpTree | |||
| Dispatched when the user doubleclicks on an item | FlpTree | |||
| Dispatched when the user drops an item on the tree which is accepted by the tree The TreeEvent contains a data property with additional information | FlpTree | |||
| Dispatched when the user opens a node The TreeEvent contains a data property with additional information | FlpTree | |||
| Dispatched when the selected node is changed The TreeEvent contains a data property with additional information | FlpTree | |||
| allowDropOnAllNodes | property |
allowDropOnAllNodes:Boolean [read-write]Gets or sets the allowDropOnAllNodes property, when true, you can drop a node on any node, when false, you can only drop on folders (nodes having a 'children' property)
Implementation public function get allowDropOnAllNodes():Boolean
public function set allowDropOnAllNodes(value:Boolean):void
| childrenField | property |
childrenField:String [read-write]Gets or sets the name of the children field of the dataProvider
Implementation public function get childrenField():String
public function set childrenField(value:String):void
| closedfoldericon | property |
closedfoldericon:* [read-write]The default icon for a closed folder
Implementation public function get closedfoldericon():*
public function set closedfoldericon(value:*):void
| closedicon | property |
closedicon:* [read-write]The default icon of the open / close button for a opened folder
Implementation public function get closedicon():*
public function set closedicon(value:*):void
| data | property |
data:Object [read-only]Implementation
public function get data():Object
| dataProvider | property |
dataProvider:ArrayCollection [read-write]The dataprovider
Implementation public function get dataProvider():ArrayCollection
public function set dataProvider(value:ArrayCollection):void
| dragEnabled | property |
dragEnabled:Boolean [read-write]Gets or sets the dragEnabled property, when enabled, you can drag items to rearrange them will also set dropenabled to true
Implementation public function get dragEnabled():Boolean
public function set dragEnabled(value:Boolean):void
| dropEnabled | property |
dropEnabled:Boolean [read-write]Gets or sets the dropEnabled property, when enabled, you can drop items in the tree, but not rearrange items
Implementation public function get dropEnabled():Boolean
public function set dropEnabled(value:Boolean):void
| dropIndicator | property |
dropIndicator:IFactory [read-write]Sets the renderer for the drop thinghy
Implementation public function get dropIndicator():IFactory
public function set dropIndicator(value:IFactory):void
| hoverDelayValue | property |
hoverDelayValue:uint [read-only]Implementation
public function get hoverDelayValue():uint
| icon | property |
icon:Class [read-write]The default icon for a node If it's a string, it sets the icon, if it's an array, it sets the icon and the folder icons if it's an object, it sets the icon and the folder icons, you can use the following names: icon - the icon foldericon - the icon for folders (opened and closed) openedfoldericon - the icon for opened folder closedfoldericon - the icon for closed folders Note: these are the default icons, the tree will look for icons in de dataprovider first. Note2: the get function allways returns the icon only, not the foldericons.
Implementation public function get icon():Class
public function set icon(value:Class):void
| iconField | property |
iconField:String [read-write]Gets or sets the field of the dataprovider which holds the icons
Implementation public function get iconField():String
public function set iconField(value:String):void
| iconFunction | property |
iconFunction:Function [read-write]Gets or sets the function to call for the icons
Implementation public function get iconFunction():Function
public function set iconFunction(value:Function):void
| indentation | property |
indentation:int [read-write]Gets or sets the indentation of child nodes
Implementation public function get indentation():int
public function set indentation(value:int):void
| itemRenderer | property |
itemRenderer:IFactory [read-write]The renderer for a node
Implementation public function get itemRenderer():IFactory
public function set itemRenderer(value:IFactory):void
| labelField | property |
labelField:String [read-write]Gets or sets the field of the dataprovider which acts as labelfield
Implementation public function get labelField():String
public function set labelField(value:String):void
| labelFunction | property |
labelFunction:Function [read-write]Gets or sets the function to call for the labels
Implementation public function get labelFunction():Function
public function set labelFunction(value:Function):void
| multiselect | property |
multiselect:Boolean [read-write]Gets or sets the multiple selection allowance
Implementation public function get multiselect():Boolean
public function set multiselect(value:Boolean):void
| openedfoldericon | property |
openedfoldericon:* [read-write]The default icon for a opened folder
Implementation public function get openedfoldericon():*
public function set openedfoldericon(value:*):void
| openedicon | property |
openedicon:* [read-write]The default icon of the open / close button for a opened folder
Implementation public function get openedicon():*
public function set openedicon(value:*):void
| openNodeOnHover | property |
openNodeOnHover:Boolean [read-write]Gets or sets the openNodeOnHover property, when true, a node will open when you drag a node over it (nodes having a 'children' property)
Implementation public function get openNodeOnHover():Boolean
public function set openNodeOnHover(value:Boolean):void
| rollOverColorValue | property |
rollOverColorValue:uint [read-only]Implementation
public function get rollOverColorValue():uint
| selectedNode | property |
selectedNode:Node [read-write]Gets or sets the selected node
Implementation public function get selectedNode():Node
public function set selectedNode(value:Node):void
| selectedNodes | property |
selectedNodes:Array [read-write]Gets the selected nodes
Implementation public function get selectedNodes():Array
public function set selectedNodes(value:Array):void
| selectionColorValue | property |
selectionColorValue:uint [read-only]Implementation
public function get selectionColorValue():uint
| textRollOverColorValue | property |
textRollOverColorValue:uint [read-only]Implementation
public function get textRollOverColorValue():uint
| textSelectedColorValue | property |
textSelectedColorValue:uint [read-only]Implementation
public function get textSelectedColorValue():uint
| verticalGapValue | property |
verticalGapValue:int [read-only]Gets the gap between nodes
The default value is = 2;.
public function get verticalGapValue():int
| FlpTree | () | constructor |
public function FlpTree()
| __dispatchTreeEvent | () | method |
public function __dispatchTreeEvent(eventType:String, data:Object):voidParameters
eventType:String |
|
data:Object |
| commitProperties | () | method |
protected override function commitProperties():void
| findNodes | () | method |
public function findNodes(property:String, value:Node, startingNode:* = null):ArrayFinds nodes with the given property and it's value. You can use nested properties (for instance data.label)
Parametersproperty:String — The property
|
|
value:Node — The value to match with
|
|
startingNode:* (default = null) — The root node to start the search from
|
Array — array The found nodes
|
| close | event |
nl.flexperiments.events.FlpTreeEvent
nl.flexperiments.events.FlpTreeEvent.CLOSE
Dispatched when the user closes a node The TreeEvent contains a data property with additional information
The close Event is called each time the user closes a node. The user receives the event with the data of the node that's being closed as data property
| itemDoubleClick | event |
nl.flexperiments.events.FlpTreeEvent
nl.flexperiments.events.FlpTreeEvent.ITEM_DOUBLE_CLICK
Dispatched when the user doubleclicks on an item
Dispatched when a user double clicks on an item
| nodeDragDrop | event |
nl.flexperiments.events.FlpTreeEvent
Dispatched when the user drops an item on the tree which is accepted by the tree The TreeEvent contains a data property with additional information
| open | event |
nl.flexperiments.events.FlpTreeEvent
nl.flexperiments.events.FlpTreeEvent.OPEN
Dispatched when the user opens a node The TreeEvent contains a data property with additional information
The open Event is called each time the user selects a node. The user receives the event with the data of the node that's being selected as data property
| selectedNodeChange | event |
nl.flexperiments.events.FlpTreeEvent
nl.flexperiments.events.FlpTreeEvent.SELECTEDNODECHANGE
Dispatched when the selected node is changed The TreeEvent contains a data property with additional information