posts - 54, comments - 158, trackbacks - 4

My Links

Archives

Post Categories

Projects

Web Dev

Table Row Reordering

This small bit javascript reorders a table's rows in groups.

 

function moveRow(table, pos1, pos2)
{
    var multiplicity = 5;
   
    var obj = table.children(0);
    if (obj.children.length > ((pos1+1)*multiplicity-1) &&
obj.children.length > ((pos2+1)*multiplicity-1)

        && pos1 >= 0 && pos2 >=0 && pos1 != pos2)
    {
        for (var i = 0; i < multiplicity; i ++)
        {
            var node1 = obj.children(pos1*multiplicity + i);
            var node2 = obj.children(pos2*multiplicity + i);
            node1.swapNode(node2);
        }
    }

}

Print | posted on Saturday, May 10, 2008 4:52 PM | Filed Under [ Web Programming ]

kick it on DotNetKicks.com

Feedback

Gravatar

# reorder table rows

reorder table rows
5/19/2008 5:06 PM |

Post Comment

Title  
Name  
Email
Url
Comment   
Please add 5 and 4 and type the answer here:

Powered by: