WebFX WebBoard
Message Thread:
View All Messages
Back to WebFX
 Sortable Table - Every Other Row, Gio, April 27, 2004
     Re:Sortable Table - Every Other Row, Erik Arvidsson, May 1, 2004

Subject: Re:Sortable Table - Every Other Row From: Erik Arvidsson Date: May 1, 2004
The best way is most likely to reorganize the hr rows after the sorting.... You might also want to remove the before the sorting and then readd them afterwards. This should actully be pretty straightforward. Something like this:

var hrRows = [];

mySortableTable.onbeforesort = function ()
{
var rows = this.element.tBodies[0].rows;
for ( var i = rows.length - 1; i >= 0; i-- )
{
if ( isHrRow(...) )
{
hrRows.push( rows[i] );
rows[i].parentNode.removeChild( rows[i] );
}
}
};

mySortableTable.onsort = function ()
{
var tb = this.element.tBodies[0];
var tr = tb.rows[ 1 ];
while ( tr )
{
tb.insertBefore( hrRows.pop(), tr );
tr = tr.nextSibling;
}
};


erik



Reply
Name: 
Email: 
Subject: 

Enter your reply to this message below. HTML tags are not supported but words that start with http://, ftp:// or mailto: are converted to links.


View All Messages
Back to WebFX