0
喜的朋友在这里展开柔性树项目是我的要求:利用其标签或其他领域
当我加倍在那个特定的项目应打开(展开)的“搜索”选项卡中单击某个项目中的“测试组树“选项卡。 搜索选项卡中的项目是列表和项目测试组树是一个TreeItem。根据我的知识,在其他选项卡中展开树项目的唯一方法是使用其标签名称(唯一)。
这里我使用了下面提到的代码来实现我的要求。现在,当我双击“搜索”选项卡中的项目时,“测试组树”选项卡将正确打开,但SelectedItem未展开(在预期的其他选项卡中打开 - 仅打开测试组树选项卡并且没有任何项其他情况发生)。 请帮我实现我的要求。
private function TSTree_itemDoubleClick(event:ListEvent):void{
var selectedItem: TSTreeItem = TSTreeItem(TSTreeTestGroup.getSelectedFolderItem());
this.TSTreeTestGroup.tabMain.selectedIndex=0; // Here i am trying to open a next tab(it works)
//var selectedSampleItem: TSTreeItem = PLTreeItem(TSTreeTestGroup.treTree.getChildByName(selectedItem.label));
TestGroupTree(TestGroupManager(this).TSTreeTestGroup).loadPartialTreeItem(selectedItem); // Here i actually want to refresh the particular tree item
TestGroupTree(TestGroupManager(this).TSTreeTestGroup).treTree.expandItem(selectedItem,true,false); // here i am trying to expand the particular tree item
//TestGroupManager(TestGroupTree(TSTree(event.currentTarget).parentDocument).parentDocument).TSTreeTestGroup.treTree.expandItem(selectedItem, true, false);
//TestGroupManager(TestGroupTree(TSTree(event.currentTarget).parentDocument).parentDocument).TSTreeTestGroup.loadPartialTreeItem(this.TSTreeTestGroup.treTree.getChildByName(selectedItem.label);
// in the following i am tryin to get the TreeItemName and expand it accordingly
TestGroupTree(TestGroupManager(this).TSTreeTestGroup).treTree.expandItem(this.TSTreeTestGroup.treTree.getChildByName(selectedItem.label), true, true);
}
<?xml version="1.0"?>
<mx:Box xmlns:mx="http://www.adobe.com/2006/mxml" implements="integras.TS.component.TSTreeComponent"
show="Component_Show();"
remove="Component_Remove();" >
<mx:TabNavigator id="tabMain" change="tabMain_Change();" styleName="plTitleWindowTabNavigator" creationPolicy="all" >
<mx:Canvas label="Test Group Tree">
<ns1:TSTree dataProvider="{dpTree}" updateComplete="treTree_UpdateComplete();" iconFunction="getTreeIcon" labelField="label" iconField="icon" showRoot="false" allowMultipleSelection="true" id="treTree" doubleClickEnabled="true" itemDoubleClick="treTree_ItemDoubleClick(event);" itemClick="treTree_ItemClick(event);" itemOpen="treTree_ItemOpen(event);" >
</ns1:TSTree>
</mx:Canvas>
<mx:Canvas label="Search" width="100%" height="100%" horizontalScrollPolicy="off" verticalScrollPolicy="off">
<mx:Canvas>
<mx:HRule/>
<mx:List dataProvider="{dpSearch}" dragEnabled="false" labelField="label" iconField="icon" id="lstSearch" doubleClickEnabled="true" itemDoubleClick="lstSearch_ItemDoubleClick(event);" itemClick="lstSearch_ItemClick(event);">
</mx:List>
</mx:Canvas>
</mx:Canvas>
</mx:TabNavigator>
</mx:Box>
感谢Advance.Please让我知道如果您有任何疑问。