how to access all item renderer of MX: Tree in?
can i access every item renderer of tree in as3 ?( note that i am using custom item renderer) lets say i want to add some button in canvas(children of custom i开发者_Python百科temRender).. like
getItemRender().addChild();
Not easily, but it is possible.
itemRenderers are stored internally in an array. USually that array is a protected variables. Take a look at listItems and freeItemRenderers and highlightItemRenderer.
They are all protected, so you'll have to extend the Tree class and expose them to access them.
If possible, I would strongly recommend putting values in your dataProvider and updating the itemRenderer based on that data; not trying to access itemRenderers directly.
tree.itemToItemRenderer([item]);
Iterate through every item that's sitting in your tree's dataProvider and pass each item into that method.
精彩评论