开发者

Find out if Flex component (tree) ist scrollable?

开发者 https://www.devze.com 2022-12-17 06:43 出处:网络
How can you find out if a Flex Component (in my case the tree) is scrollable? I tried it like this if (_listOwner.height < _listOwner.measuredHeight) {

How can you find out if a Flex Component (in my case the tree) is scrollable? I tried it like this

if (_listOwner.height < _listOwner.measuredHeight) {
  // so stu开发者_StackOverflow社区ff
}

from within the tree's item renderer but didn't succeed. Access to the tree's scrollbar is private so that I can't get the info that way.


Found a solution by extending the tree class:

public class ExtendedTree extends Tree
{
    public function ExtendedTree()
    {
        super();
    }

    public function get isVerticalScrollable():Boolean
    {
        if (super.verticalScrollBar == null || super.verticalScrollBar.visible == false)
            return false;
        return true;
    }
}


Use the maxVerticalScrollPosition and maxHorizontalScrollPosition properties.

0

精彩评论

暂无评论...
验证码 换一张
取 消