I have a mx:Tree with an object as datasource. An array with this structure
[
{label: "label1", children: [] },
{label: "label2", children: [] }
]
the problem is: If I add or remove some element (or rename some label) in this array, or in some children of this array, I need to manipulate the tree (open or close some item) to see the change. There is some way to refresh a mx:Tree ?
I suggest wrapping your array up in an ArrayCollection. Then you can call
To force the itemRenderers to refresh themselves.
Just using an array; you may have to replace the dataProvider; conceptually like this:
It’ll work, but may cause a refresh and may not keep all the items open.