here is my flash code:
import fl.controls.DataGrid;
import fl.controls.dataGridClasses.DataGridColumn;
var html_txt = '<P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="14" COLOR="#CC0000"><B><U>Template Sample2</U></B></FONT><br><br><FONT FACE="Times New Roman" SIZE="14" COLOR="#006666">The chapters in this manual are organized into the following logical groups.</FONT></P>';
var nameCol:DataGridColumn = new DataGridColumn("name");
var valueCol:DataGridColumn = new DataGridColumn("value");
var myDataGrid:DataGrid = new DataGrid();
myDataGrid.addColumn(nameCol);
myDataGrid.addColumn(valueCol);
nameCol.cellRenderer = MultiLineCell;
myDataGrid.addItem({name: html_txt, value:"Value 1"});
myDataGrid.width = 400;
myDataGrid.rowHeight = 70; //this should be auto
myDataGrid.rowCount = myDataGrid.length;
myDataGrid.move(10, 10);
myDataGrid.editable = true;
addChild(myDataGrid);
here is my MultiLineCell.as:
package {
import fl.controls.listClasses.CellRenderer;
public class MultiLineCell extends CellRenderer
{
public function MultiLineCell()
{
textField.wordWrap = true;
textField.multiline = true;
textField.autoSize = "left";
}
override protected function drawLayout():void {
textField.width = this.width;
textField.htmlText = textField.text;
super.drawLayout();
}
}
}
1, the DataGrid cell should be auto height according to the length of the html text, or I can use sroll bar here. and when i click on the cell, it want to show html text with out html tags.
I think if i can use textAre here inside DataGrid it will be great!!
help me…