components.Pagination labelRowsPerPage overwritten by localization
Describe the bug
This problem came up for me when following the advice from https://github.com/mbrn/material-table/issues/148#issuecomment-452984812, referencing this line material-table.js:449. LabelDisplayedRows and labelRowsPerPage don't work anymore.
For example:
// import { TablePagination } from '@material-ui/core';
<MaterialTable
columns={[]}
data={this.state.data}
title='Demo Title'
// ******** Some workarounds can happen out here now *******
localization={{
pagination: {
labelDisplayedRows: 'string here'
labelRowsPerPage: 'another string here'
}
}}
// ********
components={{
Pagination: props => (
<TablePagination
{...props}
// ******* These don't work anymore, because overwritten ********
labelRowsPerPage={<div style={{fontSize: 14}}>{props.labelRowsPerPage}</div>}
labelDisplayedRows={row => <div style={{fontSize: 14}}>{props.labelDisplayedRows(row)}</div>}
// *******
/>
)
}}
/>;
Related issues: https://github.com/mbrn/material-table/issues/148, https://github.com/mbrn/material-table/issues/226
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. You can reopen it if it required.
I have the same issue ...At least I saw labelDisplayedRows={row => <div style={{fontSize: 14}}>{props.labelDisplayedRows(row)}</div>} does not change the table rendering. Could this still be an ongoing issue?
I have the same issue. My function is being invoked and is returning the desired text, but not showing up in the rendered component.
[Edit] Should perhaps mention my goal in doing this. I'd like to format large count values i.e. 1,000 instead of 1000. Easy enough to do with a custom labelDisplayedRows, but since its output is being discarded/ignored, I am unable to format the count as desired.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. You can reopen it if it required.