Description
Method; replaces the item at a specified index and refreshes the display of the grid.
Example
The following example replaces the item at row index 2 with new entries. With a DataGrid
instance named
my_dg
the following code in the first frame of the main timeline:
my_dg.setSize(140, 100);
my_dg.move(10, 40);
replace_button.move(10, 10);
// Set up sample data.
var myDP_array:Array = new Array();
myDP_array.push({name:"Clark", score:3135});
myDP_array.push({name:"Bruce", score:403});
myDP_array.push({name:"Peter", score:25});
my_dg.dataProvider = myDP_array;
// Create listener object.
var buttonListener:Object = new Object();
buttonListener.click = function(evt_obj:Object) {
//Replace previous value
var prevValue_obj:Object = my_dg.replaceItemAt(2, {name:"Frank",
score:949});
my_dg.selectedIndex = 2;
};
// Add button listener.
replace_button.addEventListener("click", buttonListener);
DataGrid.resizableColumns
Availability
Flash Player 6 (6.0.79.0).
Edition
Flash MX Professional 2004.
Usage
myDataGrid.resizableColumns
and a Button instance named
on the Stage, paste
replace_button
DataGrid.resizableColumns
295
Need help?
Do you have a question about the FLASH 8-COMPONENTS LANGUAGE and is the answer not in the manual?
Questions and answers