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

Custom pagination text #84

Closed
raulzc3 opened this issue Aug 25, 2022 · 0 comments · Fixed by #85
Closed

Custom pagination text #84

raulzc3 opened this issue Aug 25, 2022 · 0 comments · Fixed by #85
Assignees
Labels
enhancement New feature or request

Comments

@raulzc3
Copy link

raulzc3 commented Aug 25, 2022

Description

It would be very usefull to have a prop that translates the pagination text or allow to have a custom text instead of the current hardcoded one (it is a good default text btw)

Implementation Model

Possible implementation:
File Pagination.tsx (line 43):

<Text size={fontSize} className={classes[1]}>
{
customPaginationText ? customPaginationText(firstRowNum, lastRowNum, maxRows) : 
        `Showing <b>${firstRowNum}</b> - <b>${lastRowNum}</b> of <b>${maxRows}</b>` }
      </Text>

I`m not really sure if this way is going to work or if it is the proper way to do it is just an example of the funcionality that I am proposing :)

It could be used like this:

Example 1:

<Datagrid  
customPaginationText = {(firstRowNum, lastRowNum, maxRows)=> `Mostrando <b>${firstRowNum}</b> - <b>${lastRowNum}</b> de <b>${maxRows}</b>`}
{...datagridProps}
/> 

Example 2:

<Datagrid  
customPaginationText = {(firstRowNum, lastRowNum, maxRows)=> `Rows <b>${firstRowNum}</b> - <b>${lastRowNum}</b> of <b>${maxRows}</b>`}
{...datagridProps}
/> 
@raulzc3 raulzc3 added the enhancement New feature or request label Aug 25, 2022
@raulzc3 raulzc3 changed the title Pagination i18n Custom pagination text Aug 25, 2022
@Kuechlin Kuechlin mentioned this issue Aug 25, 2022
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants