WebFX WebBoard
Message Thread:
View All Messages
Back to WebFX
 tablesort bug when hiding column with style="display:none;", Brian Knorr, March 25, 2003
     Re:tablesort bug when hiding column with style=, Erik Arvidsson, March 27, 2003
         Re:tablesort bug when hiding column with style=, Brian Knorr, March 27, 2003
                 Re:tablesort bug when hiding column with style - FIXED!, Andrus Moor, July 3, 2003
                     Re:tablesort bug when hiding column with style - FIXED!, Erik Arvidsson, July 4, 2003
                 Re:tablesort bug when hiding column with style= , Andrus Moor, July 2, 2003
                     Re:tablesort bug when hiding column with style=, Andrus Moor, July 2, 2003

Subject: Re:tablesort bug when hiding column with style - FIXED! From: Andrus Moor Date: July 3, 2003

Erik, chipple recommends the following change:

That certainly won't be a big performance hit.

Just change the .headerOnClick method to this:

SortableTable.prototype.headerOnclick = function (e) {
  // find TD element
  var el = e.target || e.srcElement;
  while (el.tagName != "TD")
    el = el.parentNode;
 
  this.sort(SortableTable.msie ? this.getCellIndex(el) : el.cellIndex);
};

and add this new .getCellIndex method:

SortableTable.prototype.getCellIndex = function (c) {
  var aoRowTds = c.parentNode.getElementsByTagName("TD");
  for (var i = 0; aoRowTds[i] != c && i < aoRowTds.length; i++);
  return i;
};

and this will make it work in IE whether your table has hidden columns or not. The change doesn't affect other browsers.

Can you add this change to sortabletable code ?




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