仅通过拖动来移动放在一个Flex树中 [英] Move-only with drag & drop in a Flex tree
本文介绍了仅通过拖动来移动放在一个Flex树中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有没有人有另一个想法?
Thanks。
解决方案您可以覆盖
$ $ p $
dragEnterHandler
, dragOverHandler
和 dragDropHandler
函数在树中,因为所有的都受到保护并且非常简单,为了不显示副本反馈而不是允许用户通过拖动复制:$ $ p $
覆盖保护函数dragEnterHandler(event:DragEvent):void
{
// ...
}
覆盖保护函数dragOverHandler(event:DragEvent):void
{
// ...
}
I have a tree (in Flex 3.5), and I want to use the drag & drop functionality, but I want to let the user only move nodes, not copy them. I tried listening for the dragOver event and change the drag event's action property if it indicates a copy operation, and also listening for the keyDown event and changing the feedback using the DragManager if the pressed key was ctrl, but to no avail.
Does anybody have another idea? Thanks.
解决方案
You can override dragEnterHandler
, dragOverHandler
and dragDropHandler
functions in Tree, since all are protected and quite simple, in order not to show copy feedback and not to allow user to copy via drag:
override protected function dragEnterHandler(event:DragEvent):void
{
// ...
}
override protected function dragOverHandler(event:DragEvent):void
{
// ...
}
这篇关于仅通过拖动来移动放在一个Flex树中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文