•
Lists perform worse as a function of their visible rows.
Although lists can display 5000 records, they can't render 5000 records at once. The more
visible rows (specified by the
must to do to render. Limiting the number of visible rows, if at all possible, is the best solution.
•
Lists aren't tables.
DataGrid components are intended to provide an interface for many records. They're not
designed to display complete information; they're designed to display enough information so
that users can drill down to see more. The message view in Microsoft Outlook is a prime
example. You don't read the entire e-mail in the grid; the message would be difficult to read
and the client would perform terribly. Outlook displays enough information so that a user can
drill into the post to see the details.
Understanding the DataGrid component: data model and view
Conceptually, the DataGrid component is composed of a data model and a view that displays the
data. The data model consists of three main parts:
•
DataProvider
This is a list of items with which to fill the data grid. Any array in the same frame as a
DataGrid component is automatically given methods (from the DataProvider API) that let you
manipulate data and broadcast changes to multiple views. Any object that implements the
DataProvider API can be assigned to the
recordsets, data sets, and so on). The following code creates a data provider called
myDP = new Array({name:"Chris", price:"Priceless"}, {name:"Nigel",
price:"Cheap"});
•
Item
This is an ActionScript object used for storing the units of information in the cells of a
column. A data grid is really a list that can display more than one column of data. A list can be
thought of as an array; each indexed space of the list is an item. For the DataGrid component,
each item consists of fields. In the following code, the content between curly braces (
an item:
myDP = new Array({name:"Chris", price:"Priceless"}, {name:"Nigel",
price:"Cheap"});
•
Field
Identifiers that indicate the names of the columns within the items. This corresponds to the
property in the columns list. In the List component, the fields are usually
columnNames
and
, but in the DataGrid component the fields can be any identifier. In the following
data
code, the fields are
myDP = new Array({name:"Chris", price:"Priceless"}, {name:"Nigel",
price:"Cheap"});
property) you have on the Stage, the more work the list
rowCount
and
:
name
price
DataGrid.dataProvider
DataGrid component (Flash Professional only)
property (including
:
myDP
) is
{}
label
249
Need help?
Do you have a question about the FLASH MX 2004-USING COMPONENTS and is the answer not in the manual?
Questions and answers