Tree的全部节点展开

    大家都知道应该用expandChildrenOf(item,true),但是Flex2说明中很明确写道:
"If you set dataProvider and then immediately call expandChildrenOf() you may not see the correct behavior. You should either wait for the component to validate or call the validateNow() method. "

    所以代码如下:
            
treePlayList.dataProvider=results;
//刷新
treePlayList.validateNow();
//全部展开
treePlayList.selectedIndex=0;
treePlayList.expandChildrenOf(treePlayList.selectedItem,
true);
posted @ 2007-04-12 16:37  fishert  阅读(2638)  评论(3编辑  收藏  举报