Ask a Question related to Macromedia Flash Actionscript, Design and Development.
-
kenreiss #1
Re:Using other components in Datagrid
Stuet:
Did you ever figure out how to make the text wrap in a datagrid? I can't figure it out, either! Help!?
Ken.
kenreiss Guest
-
Flash & Datagrid - Extension, Components & Recommendations
I'm looking at bringing together PHP and flash and I'm currently looking for the best, most reliable, cheapest way to accomplish that. I'm looking... -
How to use components
For example, I draw a combobox, I want to load the certain movie when the change event is triggered. How to do that? -
Components Components Components
Again with the damn component questions.... I am trying to use the accordion box (MX 2004), and would like my text to appear within the different... -
To all Gurus: How can I edit/update a DataGrid in a DataGrid (nested DataGrid)? Possible?
Hello, I am searching the whole Internet for a good example how to edit/update a DataGrid in a DataGrid (nested DataGrid). I know how to... -
PIA for COM components
Ken, Thanks for the info Kishore -
dgrigg #2
Re:Using other components in Datagrid
- Create a new movie symbol and give it the linkageId
'CellRendererWrapTextSymbol'
- Put a text field in the symbol at x:0, y:0, name it 'label_txt' and turn on
the 'multline' text
- Add this actionscript
#initclip 1
function CellRendererWrapTextClass()
{
//set the text field height to the height of the row
this.label_txt._height = this._parent._height
this.label_txt._x = 1;
if (this.hostComponent==undefined) {
this.hostComponent = (this._parent.controller==undefined) ? this._parent :
this._parent.controller;
}
//apply the style from the hostComponent to the text field
this.textStyle = this.hostComponent.textStyle;
this.label_txt.setNewTextFormat(this.textStyle);
}
CellRendererWrapTextClass.prototype = new MovieClip();
Object.registerClass("CellRendererWrapTextSymbol", CellRendererWrapTextClass);
CellRendererWrapTextClass.prototype.setSize = function(w)
{
//set the text field width to the width of the column
this.label_txt._width = w;
this.label_txt.textWidth = w;
}
CellRendererWrapTextClass.prototype.setValue = function(value, selected)
{
//only update the text if the value changes
if (value == undefined){
this._visible = false;
} else if (value != this.label_txt.text){
this.label_txt.htmlText = value;
this._visible = true;
}
}
CellRendererWrapTextClass.prototype.setFocused = function()
{
// also optional. If you want to tab into the cell in editable mode, do this
up!
}
#endinitclip
- At the grid use this code to set the cell renderer
myGrid_dg.getColumnAt(x).setCellSymbol('CellRender erWrapTextSymbol')
dgrigg Guest



Reply With Quote

