ActionScript 2.0 Components Language Reference |
|
|
|
| DataGrid component > DataGrid.spaceColumnsEqually() | |||
Flash Player 6 (6.0.79.0).
Flash MX Professional 2004.
myDataGrid.spaceColumnsEqually()
None.
Nothing.
Method; respaces the columns equally.
The following example respaces the columns of my_dg when the button is clicked. With a DataGrid instance named my_dg and a Button instance named resize_button on the Stage, paste the following code in the first frame of the main timeline:
my_dg.move(10, 40);
my_dg.setSize(200, 100);
resize_button.move(10, 10);
resize_button.setSize(200, resize_button.height);
my_dg.addColumn("guitar");
my_dg.addColumn("name");
// Set up sample data.
my_dg.addItem({guitar:"Flying V", name:"maggot"});
my_dg.addItem({guitar:"SG", name:"dreschie"});
my_dg.addItem({guitar:"jagstang", name:"vitapup"});
// Create listener object.
var buttonListener:Object = new Object();
buttonListener.click = function() {
my_dg.spaceColumnsEqually();
};
// Add button listener.
resize_button.addEventListener("click", buttonListener);
|
|
|
|