如何在Flex3中获取鼠标经过DataGrid时所在的行列索引
1.在目标dagagrid中添加mouseover监听函数。
<mx:DataGrid width="100%" height="100%" mouseOver="datagrid1_mouseOverHandler(event)">
</mx:DataGrid>
2.在as脚本中添加相应函数。
protected function datagrid1_mouseOverHandler(event:MouseEvent):void{if(event.target is DataGridItemRenderer){//项呈现器var itemRenderer:DataGridItemRenderer = event.target as DataGridItemRenderer;//列索引var columnIndex:int = itemRenderer.listData.columnIndex;//行索引var rowIndex:int = itemRenderer.listData.rowIndex;}}