フレックス4でmx:tree
を作成していて、ツリーにXMLList
ファイルが設定されていて、ファイルがデータベースから更新されています。私が達成しようとしているのは、コースの修了状況に応じて別のアイコンが表示されるようにツリーをリフレッシュすることです。Flex 4 Mx:ツリーがtree.refresh()またはtree.reset()で更新されない
問題は、ツリーは更新されていませんが、XMLList
ファイルがあるため、私は本当に助けていただければ幸いです。
ところで、私はFlexについて知らない。
は、ここでは、コードです:
public static var treeData:XMLList = new XMLList(MyString);
<mx:Tree id="myTree" width="40%" height="100%" labelField="@label" fontSize="14" focusColor="#ff5003"
render="renderTree()"
iconFunction="tree_iconFunc"
showRoot="false"
dataProvider="{treeData}"
change="treeChanged(event)"
depthColors="{myDepthColors}"
color="#006596" borderColor="#03B4EC"
click="SoundExample(String([email protected])), habilitar()"
alternatingItemColors="{myAlternatingRowColors}"
/>
public function renderTree():void {
trace("Entró a renderTree");
initAppB();
if (refreshData){
myTree.invalidateList();
refreshData = false;
myTree.openItems = Globals.treeData;
myTree.validateNow();
}
}