views:

324

answers:

1

Is it possible to get flex renderer recycling while using browser scrollbars?

I have a flex tree control with custom item renderers for rich editing of a server-side data structure which may have any number of child nodes. If at all possible, I'd like to avoid using a flex scrollbar if the content exceeds the viewable range, instead preferring to scroll with the browser's scrollbar. I could use javascript and ExternalInterface to resize the application when the tree's size changes, but my understanding is that this would cause renderers to be created for every row in the tree, which I would like to avoid for performance reasons.

+1  A: 

The Flex Tree component doesn't support something like that out of the box. It will create enough renderers to fill it's entire height, assuming the data provider is that large. Since you want it to be larger than the browser window, it will create more renderers than those bounds.

If you were willing to subclass or patch the existing Tree, you could probably add new properties to override the starting value and the height used for the calculation of the number of renderers needed. I'm not sure how much work this would be, but it could be as simple as overriding a single function where this calculation happens.

Obviously, when the browser scrolls, you'd need to pass new values for the start and end values of what's displayed in your Tree.

joshtynjala
This seems like a promising starting point. I'll probably hold off attempting to implement it for now, but thanks for the advice.
CapnNefarious