Opened 8 years ago

Last modified 2 years ago

#13356 new defect

Tree: problems dropping from another source connected to the same store

Reported by: Simon Speich Owned by:
Priority: low Milestone: 1.15
Component: Dijit Version: 1.6.0
Keywords: drag and drop, tree Cc:
Blocked By: Blocking:

Description

The parameter childItem is undefined when dropping from another source (e.g. grid) onto the tree, although the source is using the same store. This leads to calling model.newItem instead of model.pasteItem since model.isItem(childItem) returns false instead of true.

see dijit.tree.dndSource.js line 391 - 432

This can be fixed by either changing line 418:

}else if(model.isItem(childItem)){

to:

}else if(model.isItem(source.data.item)){

or by changing 395-404:

var sourceItem = source.getItem(node.id);
// Information that's available if the source is another Tree
// (possibly but not necessarily this tree, possibly but not
// necessarily the same model as this Tree)
if(dojo.indexOf(sourceItem.type, "treeNode") != -1){
	var childTreeNode = sourceItem.data,
		childItem = childTreeNode.item,
		oldParentItem = childTreeNode.getParent().item;

to:

var sourceItem = source.getItem(node.id);
var childItem = sourceItem.data.item;
// Information that's available if the source is another Tree
// (possibly but not necessarily this tree, possibly but not
// necessarily the same model as this Tree)
if(dojo.indexOf(sourceItem.type, "treeNode") != -1){
	var childTreeNode = sourceItem.data,
		oldParentItem = childTreeNode.getParent().item;	

}

Change History (5)

comment:1 Changed 6 years ago by bill

Summary: tree.dndSource.onDndRop: Parameter childItem is undefined when calling model.isItem(childItem)Tree: problems dropping from another source connected to the same store

comment:2 Changed 6 years ago by bill

Priority: highlow

comment:3 Changed 6 years ago by bill

Milestone: tbdfuture

comment:4 Changed 3 years ago by dylan

Milestone: future1.12

This really should have been addressed years ago. I suggest we consider this for 1.12.

comment:5 Changed 2 years ago by dylan

Milestone: 1.131.15

Ticket planning... move current 1.13 tickets out to 1.15 to make it easier to move tickets into the 1.13 milestone.

Note: See TracTickets for help on using tickets.