background preloader

Drag and drop

Facebook Twitter

On an ExtJS drag and drop tree using the drop or beforedrop listeners dont seem to fire. YUI Library: Detail: 1812387 - TreeView with Drag and Drop. API: treeview TreeViewEd.js (YUI Library) YUI 2: TreeView. Drag and Drop within a TreeView. Many people has asked how to drag and drop nodes on a TreeView.

Though this would seem a natural feature on a TreeView, it simply is not that easy to define. First of all, depending on the meaning of the nodes, not all of them can be dragged so that is a first issue, though it could be easily if a tree Node had a 'draggable' property. Most of the problems lie with dropping. Both the Favorites list on a browser and a window showing the file system of a disk show their information as a tree. In both, only folders can be drop targets, however, files or folders dropped in the file system will be displayed wherever they fit in the preset sort order (usually alphabetically) with folders first. Other trees have other rules. In the end, there are so many possible alternatives that there is no way to easily describe all of them via a simple set of properties.

This example shows how to match TreeView with Drag and Drop using an arbitrary way of behaving. Finally, you get to the drop part. YUI TreeView with Drag and Drop nodes | YUI Coder.