是否可以动态更改 YUI 分页数据表中的页面大小?

发布于 2024-08-02 18:18:28 字数 156 浏览 1 评论 0原文

我有一个已分页的 YUI 数据表。数据表能够使用的高度可以改变。我想要发生的是,当大小发生变化时(我已经掌握了),我可以采用新的高度并找到页面中需要容纳多少行,然后将数据表或其分页器更改为有那么多行。

YUI Datables 是否可以做到这一点?如果可以,是否有相关示例或文档?

I have a YUI Datatable which is paginated. The height the datatable is able to use can change. What I want to happen is that when there is a size change (which I already have a handle on), I can take the new height and find how many rows are going to fit in a page, then change the datatable or it's paginator to have that number of rows.

Is this something that is possible with YUI Datables, if so is there examples or documentation about it?

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

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

发布评论

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

评论(2

知足的幸福 2024-08-09 18:18:28
myDataTable.get('paginator').setRowsPerPage(25);
myDataTable.get('paginator').setRowsPerPage(25);
等往事风中吹 2024-08-09 18:18:28

看起来,如果您可以获得对 YAHOO.widget.Paginator 实例的引用,则可以调用:

theTablesPaginator.setRowsPerPage(numRows, silent)

其中静默选项允许设置是否应发送changeRequest 事件。如果您希望重绘数据表,请将其设置为 false。

参考:非常有用的YUI官方文档

It appears that if you can get a reference to the YAHOO.widget.Paginator instance, you can call:

theTablesPaginator.setRowsPerPage(numRows, silent)

Where the silent option allows setting whether the changeRequest event should be sent. If you wish the datatable to redrawn, set this to false.

Reference: the very useful official YUI documentation

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