I have a tree component sitting in a divided box. I want to display '...' on the node labels if the divided box is resized. I have a custom itemrenderer and have been looking at the labelFunction property as well as trying various approaches in the custom itemrenderer. Not having any joy. Any pointers would be appreciated.
heres some sample code fo how I set it up...
I define a tree...
<mx:Tree
id="tree"
dataProvider="myData"
labelFunction="treeNodeLabel"
width="100%" height="100%"
click="handleClick(event)"
mouseMove="handleMouseMove(event)"
itemRollOver="handleItemOver(event)"
itemRollOut="handleItemOut(event)"
doubleClickEnabled="true"
doubleClick="handleDoubleClick(event)"
iconFunction="customIcon"
dragEnabled="true"
dropEnabled="true"
dragMoveEnabled="true"
dragOver="onDragOver(event)"
dragStart="onDragStart(event)"
dataDescriptor="{new DiagramTreeDataDescriptor()}"
itemRenderer="myCustomeRenderer"
borderStyle="none"
>
The Custom Renderer is an Actionscript class that extends TreeItemRenderer...
public class myCustomRenderer extends TreeItemRenderer {
public function myCustomRenderer() {
super();
}
/**
* Create child objects of the component.
*/
override protected function createChildren():void {
super.createChildren();
createIcon();
addListeners();
addChild(Icon1);
addChild(Icon2);
}
private function createIcon() : void {
...
}
private function addListeners() : void {
...
}
private function Icon1Click(event: MouseEvent):void {
...
}
private function Icon2Click(event: MouseEvent): void {
...
}
private function onLabelMouseOver(event : MouseEvent):void {
...
}
private function onLabelMouseOut(event : MouseEvent):void {
...
}
private function getDescription(node : XML):String {
...
}
override protected function updateDisplayList(...) {
...
}
override public function set listData(value:BaseListData):void {
...
}
}