自定义属性rowsPerPageTemplate< p:dataTAble> [英] Customize attribute rowsPerPageTemplate of <p:dataTAble>
问题描述
在我的应用程序中,我有一个< p:dataTable>
,属性 lazy =truepaginatorTemplate =... {RowsPerPageDropdown} ...rowsPerPageTemplate =10,50,100
我从一个lazyDataModel设置此datatable的value属性。我总共没有这个dataModel的记录,由 dataModelName.getRowCount()
。
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
)和一个datatable( 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>
这篇关于自定义属性rowsPerPageTemplate< p:dataTAble>的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!