views:

119

answers:

2

Hi, I'm using default drag/drop on Flex DataGrid, however, the dataGrid itself has an itemrenderer. Looks like:

 public class FlashFileDataGridRenderer extends Label{
    public function FlashFileDataGridRenderer(){
      super();
    }
override protected function updateDisplayList (unscaledWidth:Number, unscaledHeight:Number):void {
        super.updateDisplayList(unscaledWidth, unscaledHeight);
    this.setStyle("paddingLeft", "3");
        if (data instanceof FlashEntryBean) {
   if ((data.cutFlag)) {
    setStyle("color", "#AAAAAA");
   }
   else 
    setStyle("color", "#000000");
    }

That's applied to all items in the datagrid. This no longer shows the proxy with lower alpha when being dragged. I want to be able to retain that style, how can I determine if this particular item is being applied itemrenderer. I am thinking if I can determine if the object is a proxy, then fade the text myself.

Thanks!

A: 

Not sure which SDK version you're using but in 3.5 it certainly does retain grayish text color in dragged proxy.

2DH
When you have customize itemrenderer on the item being dragged, it'll have the same style as the one in itemrenderer specified, not greyish. That's the issue here.
Mike
A: 

Try moving the setStyle calls to the overriden set data method

override public function set data(t:Object):void
{
  super.data = t;
  if (data instanceof FlashEntryBean) {
    if (data.cutFlag) 
      setStyle("color", "#AAAAAA");
    else 
      setStyle("color", "#000000");
  }
}
Amarghosh