仅通过拖动来移动放在一个Flex树中 [英] Move-only with drag & drop in a Flex tree

查看:133
本文介绍了仅通过拖动来移动放在一个Flex树中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一棵树(在Flex 3.5中),我想用拖动&删除功能,但我想让用户只移动节点,而不是复制它们。我试着监听dragOver事件,如果它指示了复制操作,则更改拖动事件的action属性,并且如果按下的按键是ctrl,那么还要侦听keyDown事件并使用DragManager更改反馈,但无济于事。



有没有人有另一个想法?
Thanks。

解决方案您可以覆盖 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆