Flex的树droplocation指标卡(编辑10年2月4日,几乎是完全以不同的问题)指标、不同、编辑、问题

2023-09-08 15:34:14 作者:若安离半冬°

确定我已经有了这一点更多的研究这样做我会完全改写了一个问题: 我有两棵树,我希望能够从一棵树拖动项目到另一个。在接收树我有一些逻辑,允许或丹尼斯下降。我使用的是本地光标反馈如下:

OK I've got a little more research on this done so I'm going to totally rephrase the question: I have two trees, I want to be able to drag items from one tree to the other. In the receiving tree I have some logic that allows or denys the drop. I am using the native cursor feedback Like this :

DragManager.showFeedback(DragManager.COPY);
DragManager.showFeedback(DragManager.NONE);

在该逻辑确定无它正确地拒绝该项目除了降位置指示棒一样的截图。

When the logic determines NONE it properly rejects the item except the drop position indicator sticks like in the screenshot.

我现在知道,不管dragComplete,也不是的DragDrop被解雇在这种情况下,所以我没有功能把code到将清理一下。所以,我怎么可以听此拖动拒绝?

I know now that neither dragComplete, nor dragDrop are being fired in this situation, so I have no function to put code into that would clean that up. So how can I listen for this drag rejection?

截屏显示应用降后

谢谢 〜麦克

PS与我的其他问题:how-do-i-detect-that-drag-and-drop-operation-ended我们得到的事件的方式来火,所以我们可以清理树控件。我附加一个事件监听器的阶段,这样,当鼠标移动(或许我把它放在一个定时器),它会不断地检查是否dragmanager.isdragging,如果它是不是会触发tree.hideDropFeedBack。这还引出了一个问题,什么事件被改变isDragging布尔和我怎么听呢?

PS with my other question: how-do-i-detect-that-drag-and-drop-operation-ended We have a way of getting an event to fire so we can clean up the tree control. I'm attaching an event listener to the stage so that as the mouse is moved (maybe I'll put it on a timer)it will constantly check if dragmanager.isdragging if it's not it will fire the tree.hideDropFeedBack. This still begs the question, what event is changing the isDragging Boolean and how do I listen for it?

推荐答案

您需要调用 tree.hideDropFeedback(); 将event.target .hideDropFeedback(); 删除落指标

You need to call tree.hideDropFeedback(); or event.target.hideDropFeedback(); to remove the drop indicators.