flex list拖拽 calculateDropIndex方法的使用

来源:互联网 发布:灌砂法压实度试验算法 编辑:程序博客网 时间:2024/05/22 12:13

flex list calculateDropIndex方法的使用,获取当前位置


protected function dragOverHandler(event:DragEvent):void
   {
    var dropTarget:List = List(event.currentTarget);     
    var r:int = dropTarget.layout.calculateDropLocation(event).dropIndex    
    
    dropTarget.selectedIndex=r;
    btn1.label=r.toString();
   }


spark calculateDropIndex()

Calculate the drop index
Returns the item index in the data provider of the drop target where the item will be dropped. Used by the
dragDrop
event handler to add the items in the correct location.
Not available in the MX TileList or HorizontalList controls.
Use the
spark.layouts.supportClasses.LayoutBase.calculateDropLocation()
method. Use the
layout
property of the list class to access this method in the layout class of the component.
Use the
mx.controls.listClasses.ListBase.calculateDropIndex()
method.



0 0