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

Customizable Paginator using Templating #88

Closed
Julienng opened this issue Sep 7, 2017 · 3 comments
Closed

Customizable Paginator using Templating #88

Julienng opened this issue Sep 7, 2017 · 3 comments
Assignees
Labels
Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add
Milestone

Comments

@Julienng
Copy link

Julienng commented Sep 7, 2017

I miss a something with customisation with the current header that I can do with PrimeFaces : paginatorTemplate.

I think we can have something similar. Like :

<Datatable>
<Datatable.Header>
{({paginator/* more parameter can be pass if we need */}) => {
  return <div>
    {/* my custom component */}
    {paginator}
</div>
}}
</Datatable.Header>
</Datatable>

or

<Datatable
  header={({paginator}) => {
  return <div>
    {/* my custom component */}
    {paginator}
</div>
}}
>
</Datatable>

If the paginator position is bottom, paginator for header would be null.
If the pagination is false, paginator is null.

The same apply for the footer.

This change would be awesome, I'm ok to provide a PR if needed

@cagataycivici cagataycivici changed the title Customisation header datatable Paginator Template for Paginator and DataTable Sep 11, 2017
@cagataycivici
Copy link
Member

I think we can solve it the same as PrimeFaces using paginatorTemplate property.

@cagataycivici cagataycivici self-assigned this Sep 11, 2017
@cagataycivici cagataycivici added the Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add label Sep 11, 2017
@cagataycivici cagataycivici added this to the 1.0.1 milestone Sep 11, 2017
@cagataycivici
Copy link
Member

cagataycivici commented Sep 19, 2017

From the docs;

Template
Paginator elements can be customized using the template property using the predefined keys, default value is "FirstPageLink PrevPageLink PageLinks NextPageLink LastPageLink RowsPerPageDropdown". Here are the available elements that can be placed inside a paginator.

FirstPageLink
PrevPageLink
PageLinks
NextPageLink
LastPageLink
RowsPerPageDropdown
CurrentPageReport

So you can do;

DataTable paginatorTemplate="template="RowsPerPageDropdown PageLinks FirstPageLink PrevPageLink CurrentPageReport NextPageLink LastPageLink"

@cagataycivici cagataycivici changed the title Paginator Template for Paginator and DataTable Customizable Paginator using Templating Sep 19, 2017
@Julienng
Copy link
Author

How can I add a custom element in it ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add
Projects
None yet
Development

No branches or pull requests

2 participants