jQuery 表排序器是否有实际的最大行数?
我以一种非常简单的方式使用 jQuery tablesorter 插件,为五列表的前四列添加可排序性。任何列的最大宽度均为 255 个字符,大多数列都比该宽度窄。
这在较小的结果集上工作得很好,但是如果我的表(基于搜索查询)增长超过约 300 行,则在页面显示之后,在 tablesorter 函数所做的 DOM 更改可见之前会出现很长的延迟,并且我经常出现以下浏览器错误(在 Firefox 中):
此页面上的脚本可能正忙,或者可能已停止响应。您可以停止脚本 现在,在调试器中打开脚本,或者让脚本继续。
可排序表的大小是否有实际限制?
I'm using the jQuery tablesorter plugin in a very simple way, to add sortability to the first four columns of a five column table. The maximum width of any of the columns is 255 characters, and most are narrower than that.
This works just fine on smaller result sets, but if my table (based on a search query) grows over ~300 rows, there is a long delay after the page displays before the DOM changes made by the tablesorter function are visible, and I often get the following browser error (in Firefox):
A script on this page may be busy, or it may have stopped responding. You can stop the script
now, open the script in the debugger, or let the script continue.
Is there just a practical limitation for the size of a sortable table?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这取决于机器的速度以及人们使用的浏览器。为了获得好的数字,您必须使用人们期望使用的最慢的机器进行测试,并找到可以排序的最大数据集。此外,根据数据的当前顺序,对数据进行排序可能需要更长或更短的时间。
这个问题有很多变数。
This depends on the speed of the machine as well as which browser people are using. To get good numbers you'd have to test using the slowest machine you'd expect people to use and find the largest set of data that could be sorted. Also the data being sorted might take longer or shorter amounts of time depending on the current order of the data.
There are a lot of variables to this problem.
任何排序实现对于实时排序都有实际限制。
我见过很多像这样的排序脚本也结合了分页部分,因此一次只显示 50 个左右。我不确定脚本使用什么排序算法,但其中一些算法可能非常慢。
此表显示了一些常见排序算法的复杂性。
Any sort implementation has a practical limitation for realtime sorting.
I've seen many sort scripts like this also combine a pagination portion so that only 50 or so are shown at a time. I'm not certain what sorting algorithm the script is using but some of them can be very slow.
This table shows the complexity of some common sort algorithms.