Custom CellRenderer issue, using Flash DataGrid in Using FlashPro CS6.
Bottom line:
Can’t get a Datagrid MyCustomRenderer extends UIComponent to pick up skins;
or a MyCustomRenderer extends CellRenderer to fire
DataGridEvent.ITEM_EDIT_BEGIN or DataGridEvent.ITEM_EDIT_BEGINNING.
I am looking for one or the other, to do both.
(My preference would be extending CellRenderer).
Platform:
. FlashPro CS6 . Flash DataGrid component . All code in AS3 class files.
How I got here
import fl.controls.listClasses.CellRenderer;
import fl.controls.listClasses.ICellRenderer;
import fl.controls.listClasses.ListData;
import flash.events.Event;
import fl.events.DataGridEvent;
import flash.events.MouseEvent;
import flash.text.TextFormat;
import flash.text.TextFormatAlign;
import flash.display.Sprite;
// The grid is set to be editable.
public class MyRenderer extends CellRenderer implements ICellRenderer
// NEITHER OF THESE FIRE -- but the Up/Over/etc skinning is fine.
addEventListener(DataGridEvent.ITEM_EDIT_BEGIN, function()
{ trace (" [inside the cellrender] " +
"MyRenderer:DataGridEvent.ITEM_EDIT_BEGIN"); } );
addEventListener(DataGridEvent.ITEM_EDIT_BEGINNING, function()
{ trace (" [inside the cellrender] " +
"MyRenderer:DataGridEvent.ITEM_EDIT_BEGINNING"); } );
public class MyRenderer extends UIComponent implements ICellRenderer {
// THESE DO FIRE -- but the Up/Over/etc skinning does not work.
addEventListener(DataGridEvent.ITEM_EDIT_BEGIN, function()
{ trace (" [inside the cellrender] " +
"MyRenderer:DataGridEvent.ITEM_EDIT_BEGIN"); } );
addEventListener(DataGridEvent.ITEM_EDIT_BEGINNING, function()
{ trace (" [inside the cellrender] " +
"MyRenderer:DataGridEvent.ITEM_EDIT_BEGINNING"); } );
I would love an AS3 example where a customRenderer extending Either UIComponent or CellRenderer does both skinning and fires the datagrid events.
Thank you!