3 Replies Latest reply on Jan 16, 2008 2:23 PM by sulletf

    datagrid and mouseover event

    KomputerMan.com Level 1
      Hello all Flexers...
      I have a datagrid that contains the names of all of the reports that can be generated in my application. When the user clicks on the report and then a clicks a generate report button the selected report gets generated. This works great as a menuing system to generate reports.

      What I want to do now is capture a mouse over event so when the mouse is over a report name in the datagrid a textarea box gets populated with the description of the report.

      I have this working when using checkboxes in a repeater using the following code:

      private function setCompDesc(s:String):void {
      compDescArea.text=s;
      }

      <mx:VBox x="700" y="19" width="225" height="321" borderStyle="none">
      <mx:Repeater id="compData" dataProvider="{compList}">
      <mx:CheckBox id="myCompNames" label="{compData.currentItem.ComponentName}" validationSubField="{compData.currentItem.CompCnt}"
      styleName="CheckBox" enabled="true" selected="false" click="anyEvent()"
      mouseOver="setCompDesc(event.currentTarget.getRepeaterItem().ComponentDesc)" mouseOut="compDescArea.text=''" />
      </mx:Repeater>
      </mx:VBox>

      Now I need to do the same thing with the datagrid instead of the checkbox in the repeater. This is what I have so far (but it is not working...)

      <mx:DataGrid id="reportsGrid" dataProvider="{reportList}" change="doClick()" width="400" height="180"
      mouseOver="setRptDesc(event.currentTarget.valueOf().ReportDesc)"
      styleName="DataGrid" fontFamily="Arial" fontSize="10" textAlign="left" fontWeight="bold" x="0" y="45">
      <mx:columns>
      <mx:Array>
      <mx:DataGridColumn dataField="ReportName" headerText="Existing Reports" width="300" />
      <mx:DataGridColumn dataField="RptType" headerText="Report Type" width="100" />
      </mx:Array>
      </mx:columns>
      </mx:DataGrid>

      So the question is how do I pass the value of the item being mouse overed in the datagrid to a function??? Actually I want to pass the value of a cell in the array that is used to populate the datagrid but is not displayed in the datagrid itself.

      Thanks in advance for the assist!!!

      Have an Ordinary Day...
      KomputerMan ~|:-)