Today I’m releasing another component, a smooth scrolling List that supports variable row height. I’ve got three demos of it, the first compares the standard Flex 3 List with my List, the second is another comparison but with a larger data set, and the third is a demo using the eBay API to pull down and display search results.
Ok, it’s not a Flex 3 List and it doesn’t extend ListBase or even ScrollControlBase. It uses the virtualization feature of the Scroller component I demoed previously to manage scrollPosition.
There are a few reasons I didn’t use ListBase or ScrollControlBase. I’ve never felt comfortable with ListBase controlling the backgrounds and interactivity of its itemRenderers. It always seems like a violation of encapsulation, and it bloats the List classes. ScrollControlBase seemed like a place to start, until I realized I was writing tons of code in my List class just to handle scrollbars, so I pulled that out into the Scroller.
The class that really made it possible was RepeaterData. He’s the model class behind the list and the reason I know what item renderers to create, but he deserves a blog post of his own.
Right now it’s still very incomplete. It’s not very optimized, I can already think of places that speed could be improved. It doesn’t watch the data provider for refresh events. It doesn’t manage selection or selected items (yet). It’s up to the itemRenderer to handle all interaction, and it definitely doesn’t support any kind of drag and drop gestures. It’s really just a weekend experiment, but if you want to see it expounded on, leave a message in the comments. If you want to mess with it, it’s available at the PTLib github repository.
