Paginator Paginator is a generic widget to display content in paged format.

Default

PrimeElement

$('#pag').puipaginator({
    totalRecords: 50,
    rows: "5"
});
                                
<div id="pag"></div>
                                
Name Type Default Description
page integer 0 Index of the active page.
rows integer false Defines number of data on a page.
totalRecords integer 0 Total number of records.
pageLinks integer false Defines number of page links.
template integer {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} Customizable paginator template using paginator element keys.
Name Parameters Description
paginate event: puipaginatorpaginate event,
state: {
    first: First record,
    rows: Number of rows,
    page: Current page,
    pageCount: Total number of pages,
    pageLinks: Number of page links
}
Fired when page changes.
            $('#default').puipaginator({
                paginate: function(event, state) {
                    //...
                }
            });
                                
Name Parameters Description
option name: Name of the option Returns the value of the option.
option name: Name of the option, value: Value of the option Set the value of the option.
setPage(page, silent) page: New page number
silent: Updates ui without calling paginate callback
Sets the new page and updates the ui.

Example

$('#default').puipaginator('page', 2);
                                
$(function() {
    $('#pag').puipaginator({
        totalRecords: 50,
        rows: "5"
    });
}); 
                                
<h3 class="first">Default</h3>
<div id="pag"></div>

<h3>PrimeElement</h3>
<p-paginator totalrecords="100" rows="5" template="{FirstPageLink} {PreviousPageLink} {NextPageLink} {LastPageLink} {PageLinks}"></p-paginator>
                                

Usage

<p-paginator totalrecords="100" rows="5" template="{FirstPageLink} {PreviousPageLink} {NextPageLink} {LastPageLink} {PageLinks}"></p-paginator>
                                

Attributes

Name Type Default Description
page integer 0 Index of the active page.
rows integer false Defines number of data on a page.
totalrecords integer 0 Total number of records.
pagelinks integer false Defines number of page links.
template String {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} Customizable paginator template using paginator element keys.
onpaginate function null Name of the function to invoke on page change.

Methods

Name Parameters Description
setPage(page, silent) page: New page number
silent: Updates ui without calling paginate callback
Sets the new page and updates the ui.