List with truncation instead of a horizontal scroll bar
The default spark List will add a horizontal scroll bar when the contents of the List are wider than its width. This post shows how to change that behavior using a custom item renderer so that a truncation mark like an ellipsis is used instead.
Notice in the following example that when you make the width of the Lists smaller, the top (default) List puts in a horizontal scroll bar and abruptly clips the text whereas the bottom List doesn’t show a scroll bar, but instead shows an ellipsis “…” truncation mark indicating that there is some excess text that is being cut off.
From here it might be cool to make the text automatically scroll when you hover over the item. I’ll leave that as an exercise to the reader or maybe a future post if there is enough interest.
Note: This sample requires Flex SDK 4.0.0.13982 or higher. You can get the latest SDK builds from opensource.adobe.com.
cool!
Very helpful! Thank you!
looks like what i need…
Great post! Small and helpful
Layouts really make our life easier.