1 Reply Latest reply on Mar 2, 2007 4:14 PM by tspratt

    button in datagrid cell not firing click event

      I have a datagrid with a custom button renderer built in Actionscript. I'm trying to figure out how to capture the click event of the component when the button is clicked.

      I'm generating the component from the cell depending on the type of field:
      column.itemRenderer = new ClassFactory(DpFileRenderer);

      The actual component:

      package joe.ui {
      import mx.controls.Button;
      import flash.events.MouseEvent;
      import flash.events.Event;

      public class DpFileRenderer extends Button
      private var diskIcon:Class;
      private var diskIconDisabled:Class;

      override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
      super.updateDisplayList(unscaledWidth, unscaledHeight);
      this.label = this.listData.label;
      if(this.listData.label != '0')
      this.setStyle("icon", diskIcon);
      } else {
      this.setStyle("icon", diskIconDisabled);
      this.enabled = false;
      this.labelPlacement = "left";
      this.setStyle("color", 0x000000);

      I'm not exactly sure on where to put an event broadcast in there.

      Could anybody help?