Ticket #5836 (closed defect: invalid)

Opened 9 months ago

Last modified 6 months ago

Tree: dnd between tree and target broken

Reported by: guest Owned by: bill
Priority: normal Milestone: 1.2
Component: Dijit Version: 1.0
Severity: normal Keywords:
Cc:

Description (last modified by bill) (diff)

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

Changed 9 months ago by elazutkin

  • owner changed from elazutkin to bill
  • priority changed from high to normal
  • severity changed from critical to normal

Changed 8 months ago by bill

  • summary changed from dnd between tree and target broken to Tree: dnd between tree and target broken

Changed 8 months ago by bill

  • component changed from DnD to Dijit
  • milestone changed from 1.1 to 1.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.

Changed 6 months ago by bill

  • status changed from new to closed
  • resolution set to invalid
  • description modified (diff)

No response for two months... closing.

Note: See TracTickets for help on using tickets.