Flex tree 展开任意想展开的节点

mytree.selectedIndex = 0;
mytree.expandItem(mytree.selectedItem,true);
mytree.expandChildrenOf(mytree.selectedItem,true);
//
				for each (var treeItem:XML in xml){
					if (treeItem.@name == "巡查维护"){
						mytree.expandItem(treeItem,true);
						break;
					}
				}
				//循环最后一层节点的数据,此节点就是应选择的节点数据,可根据层级关系来设置选中那一节点
				for each (var treeItem:XML in xml.children()){
				    if (treeItem.@name == "闸站"){
					mytree.expandItem(treeItem,true);
					break;
				}
						
				}

你可能感兴趣的:(Flex)