Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Datatable paginator add template feature #4329

Closed
Ketec opened this issue Nov 1, 2017 · 3 comments
Closed

Datatable paginator add template feature #4329

Ketec opened this issue Nov 1, 2017 · 3 comments
Assignees
Labels
Type: New Feature Issue contains a new feature or new component request
Milestone

Comments

@Ketec
Copy link

Ketec commented Nov 1, 2017

[ ] bug report => Search github for a similar issue or PR before submitting
[ x] feature request => Please check if request is not on the roadmap already https://github.com/primefaces/primeng/wiki/Roadmap
[ ] support request => Please do not submit support request here, instead see http://forum.primefaces.org/viewforum.php?f=35

Current behaviour
There is a simple pagination with buttons and not information about total pages and/or records.

Expected behavior
Allow templating to provide custom displays for extra pagination info.
For example:

<div class="ui-paginator-bottom-wrapper" *ngIf="paginator">
                <div class="ui-paginator-bottom ui-paginator ui-widget ui-widget-header">
                    <span class="status-label">
                        {{totalRecords < 1 ? 0 : first + 1}} - {{totalRecords > 0 ? ((rows + first) <= totalRecords ? (rows + first) : totalRecords) : 0}} of {{totalRecords ? totalRecords : 0}}
                    </span>
                </div>
                <p-paginator [rows]="rows" [first]="first" [totalRecords]="totalRecords" [pageLinkSize]="pageLinks" styleClass="ui-paginator-bottom"
                             [alwaysShow]="alwaysShowPaginator"
                             (onPageChange)="onPageChange($event)" [rowsPerPageOptions]="rowsPerPageOptions"
                         *ngIf="paginator && (paginatorPosition === 'bottom' || paginatorPosition =='both')"></p-paginator>
            </div>

Would right now show total records and current page records ( with 100 records per page it would be 1-100 of 1000, next page 101-200 of 1000).
Make this possible through custom templating (providing access to required paginator values).
Optionally could make the whole paginator section templateable so custom paginator designs could be implemented.

@cagataycivici cagataycivici added the Type: New Feature Issue contains a new feature or new component request label Nov 6, 2017
@cagataycivici cagataycivici self-assigned this Nov 16, 2017
@cagataycivici cagataycivici added this to the 5.0 milestone Nov 16, 2017
@Ketec
Copy link
Author

Ketec commented Nov 16, 2017

Does it provide access to paginator variables like:
[rows]="rows" [first]="first" [totalRecords]="totalRecords" [pageLinkSize]="pageLinks"

Or is it just static template that has no connection to the paginator itself?

For example:
<ng-template pTemplate="paginatorLeft" let-totalRecords="totalRecords">{{totalRecords}}</ng-template>

@cagataycivici cagataycivici modified the milestones: 5.0.0-RC0, 5.0 Nov 20, 2017
@cagataycivici
Copy link
Member

Currently static, if you need more info on page state, please create a separate ticket and we'll do it for 5.0.1

@izy2nv
Copy link

izy2nv commented Nov 21, 2017

@cagataycivici Is there a fix for rowsPerPageOption for 'ALL' in case user wants to display all records on Datatable (without pagination). This is highly needed in a project i'm working on. If not yet implemented, is there a work around you can suggest? Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: New Feature Issue contains a new feature or new component request
Projects
None yet
Development

No branches or pull requests

3 participants