« Flex + AJAX > Flex vs. AJAX | Main | Binding custom objects to Tilelist with itemRenderer »

Dynamically adding children to a tree

[The following was created as of Flex 2, Beta 2]

In working on my Flickr app, I needed a Tree that had a couple requirements:

1) The data for the tree was not simply storable in one data-provider without a lot of work. Plus, it seemed pointless to load all that data (potentially hundreds of leaf noded under the branch nodes) to start with considering the chances of it all getting looked at were quite slim.

2) So, because of the decision made in #1, I needed to dynamically add children to the Tree as the user started opening up tree branches.

So, here's a simplified version of what I came up with:

View the source here

Save This Page    

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)