Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/sharepoint/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Apache flex 计算位置不工作_Apache Flex_Air_Drag And Drop - Fatal编程技术网

Apache flex 计算位置不工作

Apache flex 计算位置不工作,apache-flex,air,drag-and-drop,Apache Flex,Air,Drag And Drop,我有一个itemrenderer和arraycollection作为数据提供者。 现在我的问题是我希望能够拖放来重新排序这些项目 为此,我需要知道拖动的项索引和放置位置。 我有所选项目索引,但当我想在dragcompletehandler中使用此代码计算放置位置时 它总是返回数字3,而不是正确的放置位置索引 这怎么可能呢?列表应该为您拖放。设置dragEnabled=true、dropEnabled=true和dragMoveEnabled=true,就完成了。从列表中拖动将对其重新排序 如果您

我有一个itemrenderer和arraycollection作为数据提供者。 现在我的问题是我希望能够拖放来重新排序这些项目

为此,我需要知道拖动的项索引和放置位置。 我有所选项目索引,但当我想在dragcompletehandler中使用此代码计算放置位置时

它总是返回数字3,而不是正确的放置位置索引


这怎么可能呢?

列表应该为您拖放。设置dragEnabled=true、dropEnabled=true和dragMoveEnabled=true,就完成了。从列表中拖动将对其重新排序


如果您想要手动实现drop,您应该在dragDrop处理程序上执行您的工作,因为它只在有效的dragDrop上执行。当组件未标记为接受拖动时,即使没有有效的拖放项,也会激发dragComplete事件。

CalculatedReplocation始终返回最后一行。截至4.6,代码不完整

不使用x、y坐标。如果你介入,你会发现我做了什么

重写或调用您自己的CalculatedReplocation函数

var dropLocal:DropLocation = listfiles.layout.calculateDropLocation(event);
trace (event.currentTarget.selectedIndex + "," + dropLocal.dropIndex);