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)
new in version 1.3.1
- Added openicon and closedicon, so you can change the default open/close button appereance
new in version 1.3.0:
- Added a filterfunction. You can now filter the tree as you would with a normal arraycollection
- Fixed some events (like labelfunction, which was dispatching the wrong event)
- Made the displayobjects in the defaultrenderer protected so you can access them more easily when extending it
new in version 1.2.2:
- Fixed the dragging bug, moving nodes before or after nodes is possible again
new in version 1.2.1:
- Finally fixed the height bug, may need some testing tho!
new in version 1.2.0:
- Several bug fixes:
- FindNode(s) works now properly
- Selection and multiselect now works
- Other bugs which I forgot about
- Performance tweaks
- Added open on hover
new in version 1.1.0b
- Caching / recycling of children
- Double click support
- LabelFunction & IconFunction support added
new in version 1.0.2b
- fixed the labelfield / iconfield bug
- you can now acces objects in the tree for the labelfield. For instance, you can set 'obj.label' as
labelField. It will then set the label as data[obj][label].
allowDropOnAllNodes:Boolean [read-write]Implementation
public function get allowDropOnAllNodes():Boolean
public function set allowDropOnAllNodes(value:Boolean):void
childrenField:String [read-write]Implementation
public function get childrenField():String
public function set childrenField(value:String):void
closedfoldericon:* [read-write]Implementation
public function get closedfoldericon():*
public function set closedfoldericon(value:*):void
closedicon:* [read-write]Implementation
public function get closedicon():*
public function set closedicon(value:*):void
dataProvider:ArrayCollection [read-write]Implementation
public function get dataProvider():ArrayCollection
public function set dataProvider(value:ArrayCollection):void
dragEnabled:Boolean [read-write]Implementation
public function get dragEnabled():Boolean
public function set dragEnabled(value:Boolean):void
dropIndicator:IFactory [read-write]Implementation
public function get dropIndicator():IFactory
public function set dropIndicator(value:IFactory):void
filterFunction:Function [read-write]Implementation
public function get filterFunction():Function
public function set filterFunction(value:Function):void
hoverDelay:Number [read-write]Implementation
public function get hoverDelay():Number
public function set hoverDelay(value:Number):void
icon:Class [read-write]Implementation
public function get icon():Class
public function set icon(value:Class):void
iconField:* [read-write]Implementation
public function get iconField():*
public function set iconField(value:*):void
iconFunction:Function [read-write]Implementation
public function get iconFunction():Function
public function set iconFunction(value:Function):void
indentation:int [read-write]Implementation
public function get indentation():int
public function set indentation(value:int):void
itemRenderer:IFactory [read-write]Implementation
public function get itemRenderer():IFactory
public function set itemRenderer(value:IFactory):void
labelField:String [read-write]Implementation
public function get labelField():String
public function set labelField(value:String):void
labelFunction:Function [read-write]Implementation
public function get labelFunction():Function
public function set labelFunction(value:Function):void
multiselect:Boolean [read-write]Implementation
public function get multiselect():Boolean
public function set multiselect(value:Boolean):void
openedfoldericon:* [read-write]Implementation
public function get openedfoldericon():*
public function set openedfoldericon(value:*):void
openedicon:* [read-write]Implementation
public function get openedicon():*
public function set openedicon(value:*):void
public var __openItems:ArrayCollection
openNodeOnHover:Boolean [read-write]Implementation
public function get openNodeOnHover():Boolean
public function set openNodeOnHover(value:Boolean):void
selectedNode:Node [read-write]
Implementation
public function get selectedNode():Node
public function set selectedNode(value:Node):void
selectedNodes:Array [read-write]Implementation
public function get selectedNodes():Array
public function set selectedNodes(value:Array):void
verticalGap:int [read-write]Implementation
public function get verticalGap():int
public function set verticalGap(value:int):void
width:Number [write-only]
Gets or sets the width of the tree
This property can be used as the source for data binding.
Implementation
public function set width(value:Number):void
public function FlpTree()
public function __addNode(parentUIC:UIComponent, data:Object, index:int):void
Adds a node to the tree
Parameters
| parentUIC:UIComponent — The parent UIComponent (parentNode), the node to add the new node to
|
| |
| data:Object — The data from the dataprovider
|
| |
| index:int — The index of the node
|
public function __deselectNode(node:Node):voidParameters
public function closeAll():void
Closes all nodes
protected override function createChildren():void
public function disableAll():void
Disables all nodes
public function enableAll():void
Enables all nodes
public function findNode(property:String, value:Node, startingNode:* = null):Node
Finds a node with the given property and it's value
Parameters
| property:String |
| |
| value:Node |
| |
| startingNode:* (default = null) |
Returns
public function findNodes(property:String, value:Node, startingNode:* = null):ArrayParameters
| property:String |
| |
| value:Node |
| |
| startingNode:* (default = null) |
Returns
public function openAll():void
Opens all nodes
public function openNode(node:Node):void
Opens a node
Parameters
public function refreshTree():void
Since caching is now supported, we don't rebuild the tree from the ground,
instead we try to reuse as much as possible.
public function traverseTreeWithCallback(callback:Function):void
Walks through the tree and calls the callback function for each node
Parameters
| callback:Function — The function to call
|
Event object type: nl.flexperiments.events.FlpTreeEvent
FlpTreeEvent.type property = 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
Event object type: nl.flexperiments.events.FlpTreeEvent
FlpTreeEvent.type property = nl.flexperiments.events.FlpTreeEvent.DRAGDROP
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
Event object type: nl.flexperiments.events.FlpTreeEvent
FlpTreeEvent.type property = nl.flexperiments.events.FlpTreeEvent.ITEM_DOUBLE_CLICK
Dispatched when the user doubleclicks on an item
Dispatched when a user double clicks on an item
Event object type: nl.flexperiments.events.FlpTreeEvent
FlpTreeEvent.type property = 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
Event object type: nl.flexperiments.events.FlpTreeEvent
FlpTreeEvent.type property = nl.flexperiments.events.FlpTreeEvent.SELECTEDNODECHANGE
Dispatched when the selected node is changed
The TreeEvent contains a data property with additional information
public static const VERSION:String = "1.3.1"