Some simple plugins that may help.

(function($) {
    $.fn.moveRowAfter = function(index, afterIndex)
    {
 
this.find("tr").eq(index).insertAfter(this.find("tr").eq(afterIndex));
        return this;
    };
    $.fn.moveRowBefore = function(index, beforeIndex)
    {
 
this.find("tr").eq(index).insertBefore(this.find("tr").eq(beforeIndex));
        return this;
    };
})(jQuery);

Usage:

// move first row after fourth row (won't do anything if there are
less than 4 rows in the table)
$("table tbody").moveRowAfter(0, 3);

On Jul 30, 10:16 pm, Mike Miller <[EMAIL PROTECTED]> wrote:
> Haven't been able to find any documentation so far that talks about
> how to move rows around with jquery.  Don't really need to sort the
> whole table...rather I want to move one row to another position.  Can
> this be done?

Reply via email to