Assuming that the Move Up link is within the table row and that the
link has a class of moveup, you could do something like this:
$('a.moveup').click(function() {
var $thisRow = $(this).parents('tr:first');
$thisRow.insertBefore( $thisRow.prev() );
return false;
});
--Karl
Thank you, Karl!!
Works excellent. Exactly what I needed!
Karl Swedberg wrote:
Assuming that the Move Up link is within the table row and that the
link has a class of moveup, you could do something like this:
$('a.moveup').click(function() {
var $thisRow = $(this).parents('tr:first');
good job!
2009/6/15 Paul Witschger tigerseyet...@gmail.com
Thank you, Karl!!
Works excellent. Exactly what I needed!
Karl Swedberg wrote:
Assuming that the Move Up link is within the table row and that the link
has a class of moveup, you could do something like this:
actually, there is one problem. I guess what I need is something a
little different.
Basically the same, but I need to know if the row is at the end or
beginning of the list. If a row is moving into the first spot, I need to
remove the Move Up link. Same with the row moving down (removing
Hi Paul,
This will do the trick, but it could be written a lot more elegantly
(it's midnight here, and I only had a few minutes to bang something
out):
$(document).ready(function() {
$('tr:first-child .moveup').hide();
$('tr:last-child .movedown').hide();
Karl,
Midnight or not, your code is awesome. I only had to make one tiny
alteration (to handle the table heading row), and it worked beautifully.
Thanks a lot for your help.
Paul
Karl Swedberg wrote:
Hi Paul,
This will do the trick, but it could be written a lot more elegantly
(it's
6 matches
Mail list logo