欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

Flex中在Tree綁定數(shù)據(jù)后自動展開樹節(jié)點的方法

 更新時間:2014年01月28日 17:14:01   作者:  
使用Tree組件在綁定數(shù)據(jù)后自動展開所有樹型節(jié)點(不需要用戶再自己點擊展開節(jié)點,會方 便許多),接下來為大家介紹下具體的實現(xiàn)
用Flex/Flash做開發(fā)的同志們應(yīng)該會使用 expandChildrenOf(item,true)方法來使用Tree組件在綁定數(shù)據(jù)后自動展開所有樹型節(jié)點(不需要用戶再自己點擊展開節(jié)點,會方 便許多),而在Flex開發(fā)幫忙文檔中很明確寫道:

"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. "

第一種:(已驗證)
復(fù)制代碼 代碼如下:

//全部展開,初始選中第一項

treePlayList.dataProvider=results;//刷新Tree的全部節(jié)點展開 - royanxin - royanxin的博客

treePlayList.validateNow(); //驗證并更新此對象的屬性和布局,并重繪該對象(如果需要)。

treePlayList.selectedIndex=0;

treePlayList.expandChildrenOf(treePlayList.selectedItem,true);//全部展開

第二種:
復(fù)制代碼 代碼如下:

setTimeout(IniExpand, 1000); //延時1秒

private function IniExpand():void {
TreeView1.selectedIndex=1;
TreeView1.expandItem(TreeView1.selectedItem,true);
}

第三種:
復(fù)制代碼 代碼如下:

//全部展開,初始未選中任何選項
sysTree.validateNow();
for each(var item:XML in this.sysTree.dataProvider){
sysTree.expandChildrenOf(item,true);
}

注意:

 

相關(guān)文章

最新評論