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');
$thisRow.insertBefore( $thisRow.prev() );
return false;
});
--Karl
____________
Karl Swedberg
www.englishrules.com <http://www.englishrules.com>
www.learningjquery.com <http://www.learningjquery.com>
On Jun 14, 2009, at 6:36 PM, theprodigy wrote:
I am creating an admin section for a site I'm building. One of the
options is to change the sort order of a list of items. I have all the
backend (PHP) code running properly, but having a little issue with
the jQuery.
When the user clicks the Move Up link, how can I switch the table row
containing the link they clicked on, and the one above it (row 3
becomes 2, and row 2 becomes 3)?
Thanks