请问这个继承有问题吗?为什么在DataGrid中不现实这个DataGridColumn呢
package
{
import mx.controls.dataGridClasses.DataGridColumn;
import mx.controls.DataGrid;
public class MyDataGridColumn extends DataGridColumn
{
var owner:DataGrid;
public function MyDataGridColumn(columnName:String = null){
super(columnName);
}
override public function itemToLabel(data:Object):String{
if (!data)
return " ";
if (labelFunction != null)
return labelFunction(data, this);
if (owner.labelFunction != null)
return owner.labelFunction(data, this);
if (typeof(data) == "object" || typeof(data) == "xml")
{
try
{
if ( dataField.indexOf(".")>-1){
var arr : Array = dataField.split(".");
for (var e in arr)
data = data[arr[e]];
}else{
data = data[dataField];
}
}
catch(e:Error)
{
data = null;
}
}
if (data is String)
return String(data);
try
{
return data.toString();
}
catch(e:Error)
{
}
return " ";
}
}
}