This project is read-only.

Table draganddrop

Jan 24, 2012 at 12:06 AM

Hey, I'm using the newest dragsort and dragging td in safari doesnt seem to work properly. It works in Firefox, but in safari it seems like it doesnt delete the old placeholder or something. I've checked and the table cells are still the same number, but they totally misplaced.

Jan 24, 2012 at 12:22 AM
Edited Jan 25, 2012 at 5:23 AM

Seems like there are som bugs in findPos().

Feb 18, 2012 at 11:55 PM
Edited Feb 19, 2012 at 3:22 AM

I'm afraid this looks like it's an issue with the browser's rendering engine, here's a simplified example:

$("td").mousedown(function() {
	var td = this;
	$(document).mousemove(function(e) {
		$(td).css({ position: "absolute", top: e.pageY, left: e.pageX });
	}).mouseup(function() {
	return false;

With this code if you drag a table cell and release it you can see it leaves a gap behind where the cell was originally located, when it shouldn't.

To work around this what I've decided to is to relocate the dragged item into a new temporary table while it's being dragged and then reinsert back into the table where the placeholder is once you drop it, since the issue seems to be related to a cell being positioned absolue while it's in the table. This has the benefit placeholders can now be styled since previously they weren't being used for dragging table cells. You can obtain this change here: