jQuery +表格排序器 + IE7 +大桌子=地狱

发布于 2024-10-02 16:07:59 字数 270 浏览 2 评论 0原文

我广泛使用 jQuery 和 tablesorter 插件,但对于大小较大的表(900-1200 行),该插件只是让 Internet Explorer(尝试过 7 和 8)停止运行。

是的,我想分页(不能);是的,我想告诉大家使用Chrome(不能),但我想知道是否有人有其他解决方案。也许是一个更快的表格排序插件,或者我可以尝试的东西。我真的不想做服务器端排序。

谢谢!

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!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

陪我终i 2024-10-09 16:07:59

客户端分页怎么样?速度影响可能来自 DOM 操作,而不是排序算法。因此,将数据存储在 JavaScript 数组中,仅显示前 20 项,并按数组而不是元素排序。

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.

删除→记忆 2024-10-09 16:07:59

我使用完全相同的工具遇到了完全相同的问题。您能做的最好的事情就是尝试使您的 HTML 尽可能干净。并且,始终记住在 tbody 元素之前添加 tfoot 元素。这将帮助 IE 更快地呈现表格:

<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>

即使您不需要页脚,也可以这样做。我唯一的其他建议是尝试一些 CSS 技巧来设置样式或隐藏表格,直到 javascript 加载完成。也许从动画加载 gif 开始,并在 JavaScript 完成后将其删除。

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.

蹲在坟头点根烟 2024-10-09 16:07:59

IE 8 和 Firefox 似乎无法处理大型表转储。他们肯定会在 1000 行左右发出嘎嘎声。我在我的申请中看到了这一点。

Chrome 确实速度超快,下载 1000 行 HTML 表格输出的速度快了 100 倍。

Chrome 有一个问题。大约 4,000 行后,单元格表中的类失败。当鼠标悬停在表格单元格上时,连接到操作的鼠标悬停会消失并且不会显示。

虽然下载 5000 行表需要花费 100 倍的时间,但类链接在 IE8 或 Firefox 中不会中断。但谁能等得起那么久呢。

我想我用 Chrome 打开了一个错误,但从未收到回复。

由于我的网页运行在一个封闭的环境中,所以我很容易强迫每个人都使用Chrome。

这就是开源成为问题的地方。没有人可以打电话求救!

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!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文