在Gwt中,有2个不同的包(或2个选项)进行拖动n Drop?哪一个更好? [英] in Gwt, there are 2 different packages (or 2 options) for doing drag n Drop? Which one is better?
问题描述
https://code.google.com/p/gwtquery-plugins/wiki/DragAndDropPluginForGWTDeveloppers
&
https:// code.google.com/p/gwt-dnd/source/browse/DragDrop/
为什么Google为DnD开发了2种不同的策略?哪一个更好?
由于这个API是新的,不是每个浏览器本身都支持它。请参阅 http://caniuse.com/dragndrop 。另请参阅视频及其演示让你开始。
另一边 gwt-dnd 旨在真正拖放应用程序中的小部件。所以你可以开箱即用。此外,这个图书馆不是由Google直接开发的(尽管其作者为该公司工作)。请参阅维基和 showcase 。
另一个相对较新的图书馆是drag&将插件放在 GwtQuery 。 GwtQuery是GWT的一个类似jQuery的库,其d& d支持是通过以前的插件。它还支持小区小部件之间的d& d。请参阅展示。在这种情况下,这样的库也是为了提供本地GWT小部件的d& d功能。
I know very little about Drag n Drop in Gwt. I searched on internet & it seems that there are 2 different packages (or 2 options) for doing drag n Drop.
https://code.google.com/p/gwtquery-plugins/wiki/DragAndDropPluginForGWTDeveloppers
&
https://code.google.com/p/gwt-dnd/source/browse/DragDrop/
Why Google developed 2 different strategies for DnD? Which one is better?
The GWT drag&drop implementation is based on the HTML5 D&D API. Such API basically allows you to transfer data using native drag&drop. That means you can, for instance, drag things from outside the browser. Simplifing, you need to setup a drag element, a drop target and the DataTransfer
object which will hold the actual data to transfer. I guess it can also be used to simulate drag&drop of DOM
elements (say, widgets) within an app by creating&destroying (on dragstart
and on dragend
), but its purpose is different.
Since this API is rather new, not every browser natively support it. See http://caniuse.com/dragndrop. See also this video along with its presentation to get you started.
On the other side gwt-dnd was meant to really drag&drop widgets within an application. So you can, out of the box, move things around. Also, this library is not developed directly by Google (although its author work/ed for the company). See its wiki and showcase.
Another relatively recent library, is the drag&drop plugin for GwtQuery. GwtQuery is a jQuery-like library for GWT, and its d&d support is via the previous plugin. It also support d&d between cell widgets. See its showcase. Also in this case, such library is meant to provide d&d capabilities to native GWT widgets.
这篇关于在Gwt中,有2个不同的包(或2个选项)进行拖动n Drop?哪一个更好?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!