Is it possible to find if a treeListData is having a sibling or not. In adobe Flex 4 and actionscript 3
Yes, you could check the item
property of the TreeListData
instance inside an ItemRenderer
and either:
item
as ITreeDataDescriptor
and check the hasChildren
propertyitem
as your custom class and possibly check the length of your children
collection (depending on your data-model).Example code:
protected function dataChangeHandler(event:FlexEvent):void
{
var node:TreeNode = treeListData as TreeNode;
if(node != null)
{
if(node.children != null && node.children.length > 0)
{
hasChildren = true;
return;
}
}
hasChildren = false;
}
Hope this answers your question.