#5836 closed defect (invalid)
Tree: dnd between tree and target broken
Reported by: | guest | Owned by: | bill |
---|---|---|---|
Priority: | high | Milestone: | 1.2 |
Component: | Dijit | Version: | 1.0 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description (last modified by )
The support for dropping from a tree and a target (div) is broken.
I'm not sure what the exact bug is for this: _tree.dndSelector.onMouseDown or dnd.Source.checkAcceptance...
If setting up a dijit.tree and using the _tree.dndSelector as the dndController the class has a function named onMouseDown that checks for the value of current to determine the id and the type. To me, this is a bug in itself because current doesn't get set until some event happens dealing with a container. Because there isn't a value of current, it sets the default value for the type to "data", a String.
in dnd.Source.checkAcceptance, it expects the type of the item to be an array. Then it tries to iterate over the "array" (which is really a string) resulting in no items being acceptable for dropping). Can there ever be more than one type on an item? I would assume no... Below is the code change I made to Source.checkAcceptance which allowed it to work:
if (type instanceof Array) { for(var j = 0; j < type.length; ++j){ if(type[j] in this.accept){ flag = true; break; } } } else if (type in this.accept) flag = true;
Change History (4)
comment:1 Changed 13 years ago by
Owner: | changed from Eugene Lazutkin to bill |
---|---|
Priority: | high → normal |
severity: | critical → normal |
comment:2 Changed 13 years ago by
Summary: | dnd between tree and target broken → Tree: dnd between tree and target broken |
---|
comment:3 Changed 13 years ago by
Component: | DnD → Dijit |
---|---|
Milestone: | 1.1 → 1.2 |
comment:4 Changed 13 years ago by
Description: | modified (diff) |
---|---|
Resolution: | → invalid |
Status: | new → closed |
No response for two months... closing.
Hi. You really need to list how to reproduce the bug, attaching a test case or referring to an existing test. Also, this sentence doesn't make sense:
Did you mean dragging from a tree and dropping into a target div? Or vice-versa?
Thanks.