User Guide
DataGrid.spaceColumnsEqually() 299
DataGrid.spaceColumnsEqually()
Availability
Flash Player 6 (6.0.79.0).
Edition
Flash MX Professional 2004.
Usage
myDataGrid.spaceColumnsEqually()
Parameters
None.
Returns
Nothing.
Description
Method; respaces the columns equally.
Example
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);