#14901 closed enhancement (fixed)
DnD Container only supports dnd item nodes that direct descendants of the container node
Reported by: | Kris Zyp | Owned by: | Eugene Lazutkin |
---|---|---|---|
Priority: | undecided | Milestone: | 1.8 |
Component: | DnD | Version: | 1.7.2 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
DnD Container only supports dnd item nodes that direct descendants of the container node:
https://github.com/dojo/dojo/blob/master/dnd/Container.js#L368
It is unclear why this restriction is in place. Can we allow for dnd item nodes to be nested inside other elements in a container (by removing the parent == this.parent check)?
Attachments (1)
Change History (8)
comment:1 Changed 9 years ago by
comment:2 Changed 9 years ago by
I attached a patch. Would that work? It seems to work properly in the test.
comment:3 Changed 9 years ago by
about 3 years ago i was working on a customized version of the grid that was supposed to support dnd. i remember trying some ugly hacks to see if i could make it work. fortunately, i have managed to purge most of the details from my memory, but i seem to remember that the nodes for each row were nested descendants (rather than direct descendants) of the most logical node to make the dnd container and something like this patch would have probably reduced some of the hacking. so, i'm interested in seeing what the outcome is for this ticket.
comment:4 Changed 9 years ago by
Oh I misunderstood, I thought you wanted one dndItem to contain another, rather than just having various wrapper divs within the dojo.dnd.Source. FWIW your patch is working for me.
comment:5 Changed 9 years ago by
This patch blows up in IE because parentElement
is not a thing there. Is there an alternative (or a reason it's not just using parentNode
)?
comment:7 Changed 9 years ago by
Milestone: | tbd → 1.8 |
---|
Presumably it's because that would require a lot more code. All the logic for dropping nodes (dropping node X between A and B) would have to be enhanced to detect when you were dropping one node inside another node, etc. Tree does this.