Chapter 8. Lists and ItemRenderers
In this chapter, as in some of the other chapters in this book, many
of the recipes will need to address both Spark components and MX components.
The three MX components covered (List,
Tile, and Tree) all extend the mx.controls.listclasses.ListBase class.
On the Spark side, you’ll see how to create renderers for the List component, apply styles, and create layouts
for List and other data-driven controls.
The Spark List component, along with the
Spark ButtonBar component, extends the
spark.components.SkinnableDataContainer
class. The SkinnableDataContainer enables
you to create controls whose children are generated by a data provider, and
allows for sorting, filtering, reordering, and the setting of visual
components to act as item renderers and item editors. Like the Halo List that you may be familiar with, the Spark
List component recycles all the item
renderers it creates. This means that if you create 1000 items but only 20
are visible at a given time, only 20 item renderers will be created, and
each one’s data will be refreshed as the list is scrolled so that the
correct values are displayed. All of these controls also allow for dragging
and dropping in slightly different ways, as you’ll learn.
The topics covered in this chapter do not begin to exhaust the
possibilities for working with these ListBase controls or with the Spark List and layouts. For recipes on working with
skinning, see Chapter 6. For recipes on working
with Spark Groups, see ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access