Improving TableKit’s sort performance in IE7

I noticed that TableKit‘s sort performance using IE7 grew progressively worse as tables grew in size (rows, not columns). I found the source of the problem and put in a simple fix to it. With the below change, sorting in IE7 is nearly as fast as in Firefox — that is, nearly instantaneous.

At line 322 (TableKit 1.2.1), comment the line as shown, and add the line noted.

        var tb = table.tBodies[0];
        var tkr = TableKit.Rows;
        rows.each(function(r,i) {
            tb.appendChild(r);
            //tkr.addStripeClass(table,r,i); /* THIS LINE COMMENTED */
        });
        TableKit.Rows.stripe(table); /* THIS LINE ADDED */ 

The change shouldn’t break anything as the new code added is standard TableKit code.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>