User Guide

DataGrid.addItemAt() 271
Description
Method; adds an item to the end of the grid (after the last item index).
Example
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 dont 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);
DataGrid.addItemAt()
Availability
Flash Player 6 (6.0.79.0).
Edition
Flash MX Professional 2004.
Usage
myDataGrid.addItemAt(index, item)
Parameters
index The index position (among the child nodes) at which the node should be added. The
first position is 0.
item A string that displays the node.
Returns
A reference to the object instance that was added.
Description
Method; adds an item to the grid at the position specified.
NOTE
This differs from the List.addItem() method in that an object is passed rather than a
string.