Opened 11 years ago

Last modified 7 years ago

#13791 closed defect

Tree: support DnD between trees/plain containers connected to different stores — at Version 1

Reported by: bill Owned by:
Priority: low Milestone: 1.13
Component: Dijit Version: 1.6.1
Keywords: Cc:
Blocked By: Blocking:

Description (last modified by bill)

When dragging from one Tree to another, and the Trees are connected to different stores, there are a number of pieces of missing functionality, including:

1) delete items from old store

dojo/dnd/Source.js has this code run on drop:

if(!copy && this.creator){

There's no equivalent code for when the target is a Tree. Thus, the element won't be deleted from the source, regardless of whether the source is a Tree or not.

If the source is a Tree, it becomes more complicated, because the TreeNode being dragged may represent an item with multiple parents. In this case, should the whole item be deleted, or just unlink the parent/child relationship indicated by that TreeNode? Probably the former.

2) adding nodes to target

If the user drags "Asia" from TreeA to TreeB, seems like it should move not only "Asia", but all the descendants of "Asia" too, some of which may not even have been fetched from the data store yet.

3) label created incorrectly

The itemCreator() method gets the new node's label (a.k.a. name) like this:

return {


"name": node.textContent
node.innerText ""


For TreeNodes that gets some garbage characters (newlines and spaces), and probably has issues with special characters like "&" too. Should be calling store.getLabel(node.item), or something like that.

Change History (1)

comment:1 Changed 11 years ago by bill

Description: modified (diff)
Note: See TracTickets for help on using tickets.