1 Reply Latest reply on May 4, 2010 4:29 AM by yu2009

    itemClickevent not fired

    yu2009 Level 1

      I created 2 itemClickEvent for a DataGrid items, one for clicking a row and another for clicking a column.  The itemClickEvent works fine for clicking a row, but the event is not fired for clicking a column.  See the 2 pieces of code below.  Can anyone provide a hint?  Thanks.

       

       

      // Event Not fired
      private function itemClickEvent(event:ListEvent):void {
      var iIndex:int = event.columnIndex;
      var sItem:String = dg.dataProvider[iIndex].colName;
      showPopup(sItem);
      }
      ...
      <mx:DataGrid  id="dg" width="57%" height="300" itemClick="itemClickEvent(event)" editable="false"  >

       

      // Event Fired well
      private function itemClickEvent(event:ListEvent):void {
      var iIndex:int = event.rowIndex;
      var sItem:String = dg.dataProvider[iIndex].col1;
      showPopup(sItem);
      }
      ...
      <mx:DataGrid id="dg" width="360" height="176" rowCount="8"  showHeaders="true"  itemClick="itemClickEvent(event)"  >