User Guide

308 DataGrid component (Flash Professional only)
Example
The following example calculates a value for the “Subtotal” column:
import mx.controls.gridclasses.DataGridColumn;
var my_dg:mx.controls.DataGrid;
my_dg.setSize(300, 200);
// Set up columns.
var guitar_dgc:DataGridColumn = new DataGridColumn("guitar");
var value_dgc:DataGridColumn = new DataGridColumn("value");
var tax_dgc:DataGridColumn = new DataGridColumn("tax");
var st_dgc:DataGridColumn = new DataGridColumn("Subtotal");
//Define labelFunction for Subtotal column.
st_dgc.labelFunction = function(item:Object):String {
if ((item.value != undefined) && (item.tax != undefined)) {
return "$"+(item.value+item.tax);
}
};
// Add columns to grid.
my_dg.addColumn(guitar_dgc);
my_dg.addColumn(value_dgc);
my_dg.addColumn(tax_dgc);
my_dg.addColumn(st_dgc);
// Set data model.
my_dg.addItem({guitar:"Flying V", value:10, tax:1});
my_dg.addItem({guitar:"SG", value:20, tax:2});
my_dg.addItem({guitar:"jagstang", value:30, tax:3});
DataGridColumn.resizable
Availability
Flash Player 6 (6.0.79.0).
Edition
Flash MX Professional 2004.
Usage
myDataGrid.getColumnAt(index).resizable
Description
Property; a Boolean value that indicates whether a column can be resized by a user (true) or
not (
false). The DataGrid.resizableColumns property must be set to true for this
property to take effect. The default value is
true.