User Guide

248 Chapter 6: Components Dictionary
Using the DataGrid component (Flash Professional only)
You can use the DataGrid component as the foundation for numerous types of data-driven
applications. You can easily display a formatted tabular view of a database query (or other data),
but you can also use the cell renderer capabilities to build more sophisticated and editable user
interface pieces. The following are practical uses for the DataGrid component:
A webmail client
Search results pages
Spreadsheet applications such as loan calculators and tax form applications
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 Macromedia used when
developing the List class:
Keep it small, fast, and simple.
Dont make something more complicated than absolutely necessary. This was the prime design
directive. Most of the requirements listed below are based on this directive.
Lists have uniform row heights.
Every row must be the same height; the height can be set during authoring or at runtime.
Lists must scale to thousands of records.
Lists dont measure text.
This creates a horizontal scrolling issue for List and Tree components; for more information,
see “Understanding the design of the List component” on page 451. 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 dont 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, youd need to premeasure
every row.
Left Arrow When a cell is being edited, the insertion point shifts one character to the
left. If a cell is not editable, the Left Arrow key does nothing.
Return/Enter/Shift+Enter When a cell is editable, the change is committed, and the insertion point is
moved to the cell on the same column, next row (up or down, depending
on the shift toggle).
Shift+Tab/Tab Moves focus to the previous item. When the Tab key is pressed, focus
cycles from the last column in the grid to the first column on the next line.
When Shift+Tab is pressed, cycling is reversed. All the text in the focused
cell is selected.
Key Description