MACROMEDIA FLASH MX 2004-USING COMPONENTS Use Manual page 269

Using components
Hide thumbs Also See for FLASH MX 2004-USING COMPONENTS:
Table of Contents

Advertisement

The data grid adds methods to the prototype of the Array class so that each Array object conforms
to the DataProvider API (see DataProvider.as in the Classes/mx/controls/listclasses folder). Any
array that is in the same frame or screen as a data grid automatically has all the methods
(
,
addItem()
getItemAt()
be used to broadcast data model changes to multiple components.
In a DataGrid component, you specify fields for display in the
If you don't define the column set (by setting the
DataGrid.addColumn()
been set, the data grid generates columns for each field in the data provider's first item, once that
item arrives.
Any object that implements the DataProvider API can be used as a data provider for a data grid
(including Flash Remoting recordsets, data sets, and arrays).
Use a grid's data provider to communicate with the data in the grid because the data provider
remains consistent, regardless of scroll position.
Example
The following example creates an array to be used as a data provider and assigns it directly to the
property:
dataProvider
grid.dataProvider = [{name:"Chris", price:"Priceless"}, {name:"Nigel",
price:"cheap"}];
The following example creates a new Array object that is decorated with the DataProvider API. It
uses a
loop to add 20 items to the grid:
for
myDP = new Array();
for (var i=0; i<20; i++)
myDP.addItem({name:"Nivesh", price:"Priceless"});
list.dataProvider = myDP
DataGrid.editable
Availability
Flash Player 6 (6.0 79.0).
Edition
Flash MX Professional 2004.
Usage
myDataGrid.editable
Description
Property; determines whether the data grid can be edited by a user (
property must be
focus. The default value is
If you want individual columns to be uneditable, use the
, and so on) needed for it to be the data model of a data grid, and can
) for the data grid before the
in order for individual columns to be editable and for any cell to receive
true
.
false
DataGrid.columnNames
DataGrid.columnNames
DataGrid.dataProvider
true
DataGridColumn.editable
DataGrid component (Flash Professional only)
property.
property or by calling
property has
) or not (
). This
false
property.
269

Advertisement

Table of Contents
loading
Need help?

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

This manual is also suitable for:

Flash mx

Table of Contents