简体   繁体   English

Dojo中源与目标之间的差异

[英]Difference between source and target in dojo

Both the source and the target comes under the movable class.So I have understood that both represents something similar to "dragable" as in javascript.(Is my understanding crt?) 源和目标都属于可移动类。因此,我知道它们都表示类似于javascript中的“可拖动”的东西。(我的理解是吗?)

Target Essentially it is Source wrapped in with isSource set to false. Target本质上是将Source包裹起来,并且isSource设置为false。 Instances of this class can be created from the HTML markup automatically by dojo/parser using data-dojo-type="dojo/dnd/Target". dojo / parser可以使用data-dojo-type =“ dojo / dnd / Target”从HTML标记自动创建此类的实例。

What exactly is the difference and usage of these two ie target and source? 目标和源这两个目标的区别和用法到底是什么? In event handling we mean the target as the node where the event occurs.Does the target in dojo means the same? 在事件处理中,我们将目标视为事件发生的节点.dojo中的目标是否意味着相同?

Yes you are correct dojo/dnd it is used for drag and drop. 是的,您正确的dojo/dnd用于拖放。

dojo/dnd provides the basic user interface concepts of “drag and drop” where a user interface element it clicked, dragged and then dropped in another location. dojo / dnd提供了“拖放”的基本用户界面概念,在该界面中,单击,拖动然后将其放到另一个位置的用户界面元素。 dojo/dnd uses an “avatar” to represent objects that are being dragged from one location to another dojo / dnd使用“头像”来表示从一个位置拖动到另一位置的对象

There is not great difference between source and target sourcetarget之间没有太大差异

Basically it is for convenience as target is a Boolean flag. 基本上是为了方便起见,因为target是布尔值标志。 If it is true, then this object can be used to start the DnD operation, otherwise it can serve only as a target. 如果为true,则可以使用该对象来启动DnD操作,否则它只能用作目标。 It is true by default. 默认情况下为true。

I hope it helped. 希望对您有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM