tags:

views:

21

answers:

1

I need to detect when a Flex Spark List (spark.components.List) data has changed so that I can programmatically change its scrollbar. I know that List is a an EventDispatcher but it's unclear which event I'd register for.

Edit: My List's dataProvider is an ArrayCollection that elements are added too. So the dataProvider is never replaced. I considered listening to the backing ArrayCollection, but it's possible the List will react to the change after my listener, which alters the scrollbar. Thus my listener's changes will be superseded by that of the List.

A: 

Why not add an EventListener to the ArrayCollection and give it a high priority? This would allow you to listen to update events on the data collection itself, and force your listener to occur first.

Edit: I've not tried this myself :^)

bedwyr