Certo!
Io l'ho risolto da tempo..
posto gli script che ho utilizzato per creare ad esempio una tabella al cui interno ha una colonna contenente delle TextArea con il wordWrap.
Sullo stage un DataGrid con nome istanza grid_dg
Questo è il codice sul primo frame:
codice:
import mx.controls.DataGrid;
import mx.controls.gridclasses.DataGridColumn;
// Create DataGrid columns
var col = new DataGridColumn("idversione");
col.headerText = "Versione n°";
col.width = 80;
//col.cellRenderer = "ButtonCellRenderer"; // Assign custom cell renderer
grid_dg.addColumn(col);
var col = new DataGridColumn("ardata");
col.headerText = "Data modifica";
col.width = 110;
//col.cellRenderer = "ButtonCellRenderer"; // Assign custom cell renderer
grid_dg.addColumn(col);
var col = new DataGridColumn("appunti");
col.headerText = "Note";
col.width = 800;
col.cellRenderer = "ButtonCellRenderer"; // Assign custom cell renderer
grid_dg.addColumn(col);
Questo il codice interno al file ButtonCellRenderer.as che risiede sulla stessa directory del fla:
codice:
import mx.core.UIObject;
import mx.core.UIComponent;
import mx.controls.Button;
import com.macromedia.util.ObjectIterator;
class ButtonCellRenderer extends UIComponent
{
var btn : TextField;
var listOwner : MovieClip; // the reference we receive to the list
var getCellIndex : Function; // the function we receive from the list
var getDataLabel : Function; // the function we receive from the list
function createChildren(Void) : Void
{
this.createTextField("btn",1,0,0,800,55);
}
function setValue(str:String, item:Object, sel:Boolean) : Void
{
btn._visible = (item!=undefined);
btn.text = item.appunti.text;
btn.multiline = true;
btn.wordWrap = true;
btn.selectable = false;
var myformat:TextFormat = new TextFormat();
myformat.font = "Arial";
myformat.size = 12;
btn.setTextFormat(myformat);
}
}
Spero possa esserti utile.
Ciao a presto!