Opened 11 years ago

Closed 11 years ago

Last modified 10 years ago

#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 bill)

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 11 years ago by Eugene Lazutkin

Owner: changed from Eugene Lazutkin to bill
Priority: highnormal
severity: criticalnormal

comment:2 Changed 11 years ago by bill

Summary: dnd between tree and target brokenTree: dnd between tree and target broken

comment:3 Changed 11 years ago by bill

Component: DnDDijit
Milestone: 1.11.2

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:

The support for dropping from a tree and a target (div) is broken.

Did you mean dragging from a tree and dropping into a target div? Or vice-versa?

Thanks.

comment:4 Changed 11 years ago by bill

Description: modified (diff)
Resolution: invalid
Status: newclosed

No response for two months... closing.

Note: See TracTickets for help on using tickets.