flex4treelist

Adobe Flex 4 Tree Treelistdata


Is it possible to find if a treeListData is having a sibling or not. In adobe Flex 4 and actionscript 3


Solution

  • Yes, you could check the item property of the TreeListData instance inside an ItemRenderer and either:

    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.