Opened 13 years ago

Closed 13 years ago

Last modified 12 years ago

#1714 closed defect (fixed)

Add TABLE element around dragged TBODY element

Reported by: jcarreira Owned by: alex
Priority: high Milestone:
Component: DnD Version: 0.3
Keywords: Cc:
Blocked By: Blocking:

Description

In HtmlDragAndDrop?.js in the createDragNode function, if the dragged node is a TR node, special care is taken to create TABLE and TBODY nodes to wrap around the TR node so it will lay out correctly while dragging. Since DND of TR's doesn't work in IE, it's preferable to use multiple TBODY segments as the DragSource?'s. Adding this code after the check for a TR node makes it work for TBODY nodes:

} else if (node.tagName.toLowerCase() == "tbody") {

dojo.debug("Dragging table body") Create a table for the cloned tbody var doc = this.domNode.ownerDocument; var table = doc.createElement("table"); table.appendChild(node);

Set a fixed width to the cloned TDs var domTrs = this.domNode.childNodes; var cloneTrs = node.childNodes; for (var i = 0; i < domTrs.length; i++) {

if (cloneTrs[i] && domTrs[i]) {

var domTds = domTrs[i].childNodes; var cloneTds = cloneTrs[i].childNodes; for (var j = 0; j < domTds.length; j++) {

if ((cloneTds[j]) && (cloneTds[j].style)) {

cloneTds[j].style.width = dojo.style.getContentWidth(domTds[j]) + "px";

}

}

}

}

}

Change History (3)

comment:1 Changed 13 years ago by alex

Milestone: 0.4.1
Owner: changed from psowden to alex
Status: newassigned

comment:2 Changed 13 years ago by alex

Resolution: fixed
Status: assignedclosed

(In [6625]) make DnD work for <tbody> elements as well as <tr> elements. Fixes #1714

comment:3 Changed 12 years ago by (none)

Milestone: 0.4.1

Milestone 0.4.1 deleted

Note: See TracTickets for help on using tickets.