2011-11-02 58 views

回答

0

我发现我正在寻找火花spark.components.Grid的API参考文档。 Grid提供了一种方法isCellVisible(rowIndex:int = -1, columnIndex:int = -1):Boolean

由于spark.components.Grid代表spark.components.DataGrid的网格部分,该方法可以调用如下:dataGrid.grid.isCellVisible(rowIndex);

我把这种方法在事件监听器,以确定是否一个行(对象)是在卷轴可见:

dataGrid.scroller.verticalScrollBar.addEventListener(TrackBaseEvent.THUMB_RELEASE,updateIsItemVisible); 

private function updateIsItemVisible(e:Event):void 
{ 
    var visible:Boolean = dataGrid.grid.isCellVisible(_itemIndex); 
}