下面的链接给出了很好的例子
http://issues.wenzhixin.net.cn/bootstrap-table/
但是,当分页大小从 10 更改为 1000 或 5000 时,浏览器会挂起超过 20 秒或一分钟来填充网格
数据中的记录数为 5,000 行。
数据表能够处理 5,000 条记录,但不确定此引导表问题。
如何提高性能或解决问题?是否已经存在解决此问题的解决方案?
最佳答案
你可以采用两种技术
- 分页
- 虚拟渲染
对于虚拟渲染,您可以使用一些选项,例如
"SlickGrid utilizes virtual rendering to enable you to easily work with hundreds of thousands of items without any drop in performance. In fact, there is no difference in performance between working with a grid with 10 rows versus a 100’000 rows."
The main idea is not to pollute DOM with all used tags. Instead of that - it splits the list to clusters, then shows elements for current scroll position and adds extra rows to top and bottom of the list to emulate full height of table so that browser shows scrollbar as for full list
I think that 1MIL of records for JavaScript is too much, though it is doable. If user has to wait over a second it makes user experience sluggish and unpleasant. But as seen in the tables above any browser can give you a good user experience with 100K of records or less.
关于jquery - 卡在 bootstrap 表中的 1000 或 5000 条记录上,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45875010/