jQuery + tablesorter + IE7 + large tables = hell

I use jQuery and the tablesorter plugin extensively, but with tables of significant size (900-1200 rows), the plugin just grinds Internet Explorer (tried 7 and 8) to a halt.

Yes, I'd like to paginate (can't); yes, I'd like to tell everyone to use Chrome (can't), but I'm wondering if anyone has any other solutions. Perhaps a quicker table sorting plugin, or something I can try. I really don't want to do a server-side sort.

Thanks!


How about client-side pagination? It's likely the speed hit comes from the DOM manipulation, not the sorting algorithm. So store the data in a javascript array, display only the first 20 items, and sort on the array and not on the elements.


I've had exactly the same problem with exactly the same tools. The best you can do is try to make your HTML as clean as possible. And, always remember to add a tfoot element BEFORE the tbody element. This will help IE render the table faster:

<table>
    <thead>
        <tr>
            <th>headers here</th>
        </tr>
    </thead>
    <tfoot>
        <tr>
            <td>footers here</td>
        </tr>
    </tfoot>
    <tbody>
        <tr>
            <td>body here</td>
        </tr>
    </tbody>
</table>

Even if you don't need a footer, do it this way. The only other advice I have would be to try some CSS tricks to either style or hide the table until the javascript is done loading. Maybe start with an animated loading gif, and remove it when the javascript is done.


IE 8 and Firefox cannot seem to handle large table dumps. They definitely croak at around 1000 lines. I have seen that with my application.

Chrome is literally superfast and will download 1000's of lines of HTML Table Output 100 times faster.

There is one problem with Chrome. After approximately 4,000 lines, the classes within my cell tables fail. The mouse hover which is connected to an action simply disappears and does not show up when the mouse is over a table cell.

While it takes 100 times as long to download a 5000-row table, the class links do not break in IE8 or Firefox. But who can afford to wait that long.

I think that I opened a bug with Chrome and never heard back.

Since my webpage runs in a closed environment, it is easy for me to force everyone to use Chrome.

This is where OPEN-SOURCE becomes an issue. There is no one to call for help!

链接地址: http://www.djcxy.com/p/3654.html

上一篇: 什么是构建MySQL查询的结构化方式?

下一篇: jQuery + tablesorter + IE7 +大型表格=地狱