簡體   English   中英

如何在flex中找到已刪除項目的索引

[英]How to find the index of a dropped item in flex

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

LayoutBase有一個方法calculateDropLocation ,它接受一個DragEvent並返回一個DropLocation

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

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

相關鏈接:

計算放置位置()

放置位置

拖動事件

Hiii 我是 Anil Mhetre,這是查找 S:data grid 的刪除索引的解決方案 解決方案:- 將事件偵聽器添加到我們要在其上查找刪除索引的數據網格,例如

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;
            }

dragComplete事件偵聽器中,您可以執行以下操作:

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM