Cataclysm
Cataclysm

Reputation: 8548

How to limit max pager item count in p:dataTable or p:dataGrid?

I would like to limit maximum pager item of p:dataTable or p:dataGrid. I think default is 10. I need to set it maximum of 5 pager item. Can it be possible ?

Below is my pagertemplate code.

        <p:dataGrid styleClass="bodyContent"
            var="item"  value="#{list}" 
            paginatorPosition="bottom" paginator="true" 
            rows="5" lazy="true" columns="1" layout="grid" 
            paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
            rowsPerPageTemplate="5,10,30,60"
            rowIndexVar="index">

And below is screenshoot. enter image description here

Upvotes: 1

Views: 1541

Answers (1)

Sva.Mu
Sva.Mu

Reputation: 1131

You can use pageLinks attribute to change this. In your case:

<p:dataGrid ... pageLinks="5">

Upvotes: 4

Related Questions