ActionScript 2.0 Components Language Reference |
|
|
|
| DataGrid component > DataGrid.addItem() | |||
Flash Player 6 (6.0.79.0).
Flash MX Professional 2004.
myDataGrid.addItem(item)
item An instance of an object to be added to the grid.
A reference to the instance that was added.
Method; adds an item to the end of the grid (after the last item index).
|
NOTE |
This differs from the |
This example creates one column with the heading "name" and then inserts the item_obj value for "name". Notice that the "age" value is ignored, because only the name column has been defined. If you don't specify a column (remove the addColumn line), DataGrid automatically creates the appropriate columns. With a DataGrid instance named my_dg on the Stage, paste the following code in the first frame of the main timeline:
// Add columns to grid and add data.
my_dg.addColumn("name");
var item_obj:Object = {name:"Jim", age:30};
my_dg.addItem(item_obj);
|
|
|
|