自定义 <p:dataTable> 的属性 rowsPerPageTemplate [英] Customize attribute rowsPerPageTemplate of <p:dataTAble>

查看:31
本文介绍了自定义 <p:dataTable> 的属性 rowsPerPageTemplate的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用程序中,我有一个 <p:dataTable> 属性 lazy="true" paginatorTemplate="...{RowsPerPageDropdown}..." rowsPerPageTemplate="10,50,100"我从lazyDataModel 设置了这个数据表的值属性.我通过 dataModelName.getRowCount() 得到了这个 dataModel 的总记录数.

In my application I have a <p:dataTable> with attributes lazy="true" paginatorTemplate="...{RowsPerPageDropdown}..." rowsPerPageTemplate="10,50,100" I set value attribute of this datatable from a lazyDataModel. I got total no of records of this dataModel by dataModelName.getRowCount() .

现在的问题是我想显示 rowsPerPageTemplate="10,20,50,ALL" 其中 ALL 代表 dataModel 的记录总数(即.dataModelName.getRowCount()).

Now problem is I want to show rowsPerPageTemplate="10,20,50,ALL" where ALL stands for total no of records of dataModel (ie. dataModelName.getRowCount()).

如果有人知道请帮助我.谢谢.

If anyone know this please help me. Thanks.

推荐答案

我的方法是使用 jquery 或 javascript 在客户端更改为 ALL.我有一个表单(id="form")和一个数据表(id="cars")(你试试链接 ALL 首先):

My approach is change to ALL in clientside by using jquery or javascript. I have one form(id="form") and one datatable(id="cars") inside(you try the link ALL first):

<script type="text/javascript">
                $(document).ready(function() {
                    $('#form\:cars .ui-paginator-rpp-options.ui-widget.ui-state-default.ui-corner-left')
                    .each(function() {
                        $(this).children().last().html('ALL');
                    });
                })
            </script>

这篇关于自定义 &lt;p:dataTable&gt; 的属性 rowsPerPageTemplate的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆