Specifications
85ADOBE FLEX 3
Building and Deploying Adobe Flex 3 Applications
Disabling live scrolling
Using a DataGrid control with large data sets might make it slow to scroll when using the scrollbar. When the
DataGrid displays newly visible data, it calls the
getItemAt() method on the data provider.
The default behavior of a DataGrid is to continuously update data when the user is scrolling through it. As a result,
performance can degrade if you just simply scroll through the data on a DataGrid because the DataGrid is contin-
uously calling the
getItemAt() method. This can be a computationally expensive method to call.
Yo u c a n di s a bl e t h is live scrolling so that the view is only updated when the scrolling stops by setting the
liveScrolling property to false.
The default value of the
liveScrolling property is true. All subclasses of ScrollControlBase, including TextArea,
HorizontalList, TileList, and DataGrid, have this property.
Dynamically repeating components
There are relative benefits of using List-based controls (rather than the Repeater control) to dynamically repeat
components. If you must use the Repeater, however, there are techniques for improving the performance of that
control.
Comparing List-based controls to the Repeater control
To dynamically repeat components, you can choose between the Repeater or List-based controls, such as Horizon-
talList, TileList, or List. To achieve better performance, you can often replace layouts you created with a Repeater
with the combination of a HorizontalList or TileList and an item renderer.
The Repeater object is useful for repeating a small set of simple user interface components, such as RadioButton
controls and other controls typically used in Form containers. You can use the HorizontalList, TileList, or List
control when you display more than a few repeated objects.
The HorizontalList control displays data horizontally, similar to the HBox container. The HorizontalList control
always displays items from left to right. The TileList control displays data in a tile layout, similar to the Tile
container. The TileList control provides a direction property that determines if the next item is down or to the
right. The List control displays data in a single vertical column.
Unlike the Repeater object, which instantiates all objects that are repeated, the HorizontalList, TileList, and List
controls only instantiate what is visible in the list. The Repeater control takes a data provider (typically an Array)
that creates a new copy of its children for each entry in the Array. If you put the Repeater control’s children inside
a container that does not use deferred instantiation, your Repeater control might create many objects that are not
initially visible.
For example, a VBox container creates all objects within itself when it is first created. In the following example,
the Repeater control creates all the objects whether or not they are initially visible:
<?xml version="1.0"?>










