YUI 数据表 & 没有分页的大型数据集

发布于 2024-07-30 14:40:38 字数 235 浏览 1 评论 0原文

我目前正在实现一个 YUI 数据表作为可重用的查看器,以显示供内部使用的销售报告(和其他此类内容)。 问题是,这些报告中的许多都长达甚至超过 1000 行,并且客户端性能在更新、更快的机器上成为一个问题。

由于多种原因,服务器端分页对我们来说不是一个选择(主要是因为将报表导出到电子表格时会出现问题 - 您不想要相同的分页结果)。

所以我的问题是.. 如何在不诉诸服务器端分页的情况下提高 YUI 数据表的性能?

I am currently implementing a YUI datatable as a reusable viewer to show sales reports (and other such things) for internal use. The problem is, many of these reports are up to, and even more than 1000 rows long, and client-side performance becomes an issue on even newer, faster machines.

For a variety of reasons, server-side pagination is not an option for us (mostly because it would be problematic when it comes to exporting a report to a spreadsheet -- you do not want the same paginated results).

So my question is.. in what ways can I increase performance on a YUI's datatable without resorting to server-side pagination?

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

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

发布评论

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

评论(3

情感失落者 2024-08-06 14:40:38

您想要的是客户端分页。 DataTable 对 UI 最大的影响是在渲染阶段。 对于浏览器来说,即使是自己渲染表格也非常复杂。 添加 DT 中可用的所有动态功能,您可以看到一些真正的 UI 延迟。

将您的所有数据发送给客户端。 通过客户端分页,UI 的响应速度更快且用户友好。

如果这不是一个选项,请将 renderLoopSize 配置为大约 200 或 300。这会将行的输出一次分块为 200 或 300,从而限制页面将遭受的回流次数。

What you want is client side pagination. The largest impact DataTable has on the UI is in the render phase. Tables are very complicated for browsers to render even by themselves. Add all the dynamic functionality available in DT and you can see some real UI lag.

Send all your data to the client. With client side pagination, the UI is more responsive and user friendly.

If this is not an option, configure renderLoopSize to around 200 or 300. This will chunk the output of the rows to 200 or 300 at a time, limiting the number of reflows that your page will suffer.

涙—继续流 2024-08-06 14:40:38

也许您在向用户显示结果时仍然可以使用分页,并且在导出时它将加载所有尚未加载的行?

Perhaps you could still use pagination when displaying result to a user, and when it comes to exporting it will load all not loaded yet rows?

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