如何在flex中查找已删除项目的索引

时间:2011-07-14 15:00:24

标签: flex actionscript-3

如何使用火花列表找到放入flex列表中的项目的索引?

3 个答案:

答案 0 :(得分:1)

LayoutBasecalculateDropLocation方法,该方法需要DragEvent并返回DropLocation

在列表中的DragEvent.DRAG_DROP处理程序中,您可以执行以下操作:

var dl:DropLocation = myList.layout.calculateDropLocation(myDragEvent);
var dropIndex:int = dl.dropIndex;

相关链接:

calculateDropLocation()

DropLocation

DragEvent

答案 1 :(得分:0)

dragComplete事件监听器中,您可以执行以下操作:

var indexOfDroppedItem : int = list.dataProvider.getItemIndex(event.dragSource );

答案 2 :(得分:0)

Hiii我是Anil Mhetre, 这是找到S:数据网格的丢弃索引的解决方案 解:- 向我们要查找丢弃索引的数据网格添加事件侦听器 e.g

id_DG_TestCond.addEventListener(GridEvent.GRID_MOUSE_UP,
getgridselectedIndex);
here id_DG_TestCond is the id of datagrid & getgridselectedIndex is the event handler for GridEvent.GRID_MOUSE_UP.Event handler, for the same given below:
protected function getgridselectedIndex(event:GridEvent):void
            {
             var droppingIndex = event.currentTarget.grid.hoverRowIndex;
            }
相关问题