Sortable table rows?


#1

I’ve been trying to make some table rows sortable using Scriptaculous.
I’ve
used:

Sortable.create(“secondlist”, {tag:‘tr’, treeTag:‘table’});

and

Sortable.create(“secondlist”, {tag:‘tr’});

Neither of which works. Is it even possible to do this?

Thanks,
Daniel


#2

I used this excellent javascript library for the same thing

http://kryogenix.org/code/browser/sorttable/

There is a table sorter ticket posted in scriptaculous requested
enhancements
http://dev.rubyonrails.org/ticket/2606

I dont know if this has been included yet. I have seen some sorttable
lists but dont think there is anything specific for tables but the
sorttable.js link i have provided is as good as i anything ive seen out
there.


#3

Thanks Johnny B-

I’m actually using that currently :slight_smile: My goal is to have table rows
sortable
using the kryogenix script AND by using drag and drop, like you can do
with
lists. That way if someone wants to compare to rows side by side, he
can.

The scriptaculous Sortable class(?) relies on Draggables and
Droppables…
and as far as I can tell you can’t make

's draggable unless you
change
their position to absolute, which is totally counterproductive :slight_smile:

Daniel