ActionScript 2.0 Components Language Reference |
|
|
|
| DataGrid component > Using the DataGrid component > Understanding the design of the DataGrid component | |||
The DataGrid component extends the List component. When you design an application with the DataGrid component, it is helpful to understand how the List class underlying it was designed. The following are some fundamental assumptions and requirements that Adobe used when developing the List class:
Don't make something more complicated than absolutely necessary. This was the prime design directive. Most of the requirements listed below are based on this directive.
Every row must be the same height; the height can be set during authoring or at runtime.
This creates a horizontal scrolling issue for List and Tree components; for more information, see Understanding the design of the List component. The DataGrid component, however, supports "auto" as an hScrollPolicy value, because it measures columns (which are the same width per item), not text.
The fact that lists don't measure text explains why lists have uniform row heights. Sizing individual rows to fit text would require intensive measuring. For example, if you wanted to accurately show the scroll bars on a list with nonuniform row height, you'd need to premeasure every row.
Although lists can display 5000 records, they can't render 5000 records at once. The more visible rows (specified by the rowCount property) you have on the Stage, the more work the list must to do to render. Limiting the number of visible rows, if at all possible, is the best solution.
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.
|
|
|
|