Comments on: Draggable Table Columns Keepin' static like wool fabric since 2006 Wed, 08 Oct 2014 14:33:23 +0000 hourly 1 By: brad Wed, 26 Oct 2011 02:44:42 +0000 two things i am after:

1. is it possible to lock down one column?
2. how would u add a visual indicator to show where the new column is while being dragged (perhaps something like highlighting the border between the two columns )

otherwise it works great! thanks!

By: LePirlouit Mon, 23 May 2011 07:57:51 +0000 Hi danvk,

I want to contribute to this project,

I have solved issue nr 23 about the colspan.

please add me to the project developpers.

By: Erwin Thu, 18 Dec 2008 01:17:31 +0000 Hi,

I have added a fix for the horizontal scroll of table when the total table width is greater than the screen size. I’m not sure if I have done it perfectly, but so far it seems to be working just fine.

I added this code to dragMove (You can get the getPosition() from this site:

// erwin (scroll page horizontally) START
var cursorObject = getPosition(event);
var cursorPosX = cursorObject.x;

var windowOffsetX = screen.width + document.body.scrollLeft;

if ((windowOffsetX-cursorPosX) <= 100)
document.body.scrollLeft += 5;
else if ((cursorPosX-document.body.scrollLeft) <= 100)
document.body.scrollLeft -= 5;
// erwin (scroll page horizontally) END

By: Brad Mon, 08 Dec 2008 21:12:49 +0000 I have the same issue- works great, except when the table is wide enough that I need to scroll. Then if I try to grab the rightmost column, it instead selects whatever column occupied that space before I scrolled.

Does that make sense? If your table scrolls horizontally, the javascript doesn’t detect that the columns have moved, so you end up dragging the column that used to be there.

By: Cyril Mon, 17 Nov 2008 11:16:17 +0000 Hi,
This is a very smooth and easy to use, but when the table is long & hidden in scrolling DIV the Drag does not work. :(
Can i find any solution here.

By: Colin Mon, 30 Jun 2008 23:39:34 +0000 I have a table with 8 columns and everything drags correctly.
On another page I have a table with 11 columns and it seems that the drag result is often random – and I can’t drag column 11 at all.
Is there a limit to the number of columns I can have in my table?

By: Colin Sun, 29 Jun 2008 02:11:06 +0000 This is very good. How do you get the column to visually follow the mouse?
On my table when I drag a column nothing changes visually until I release the mouse button.

By: danvk Thu, 26 Jun 2008 19:46:14 +0000 Martin — you’re right, this is certainly a drawback of dragtable (and sorttable). The right solution is to store a cookie for each table that remembers the column ordering and the sorting. I think this is more of a version 1.5 or 2.0 kind of feature, but I’ve gone ahead and created an issue for it on my google code page:

By: Martin Thu, 26 Jun 2008 19:24:51 +0000 Using this code, works a treat, so far.
I notice the underlying html is not modified so that when the page is refreshed it reverts to the original column layout.
Is there a way of preserving the new layout when a page is refreshed or you move to a new page (for printing for example), perhaps by giving each column a unique identifier and the storing the order they are put in and those variable checked first when the page refreshes/changes else going to the default layout?

Javscript is not my strongest area so maybe I’m not seeing the wood for the trees but I can’t pick out where the column references are in the code.

Any ideas?

By: danvk Mon, 23 Jun 2008 15:50:24 +0000 Thanks for the catch, Martin! I’ve fixed the link, you should be able to download dragtable.js now.