Skip to content

Commit

Permalink
Added: "All" option to "rows per page" in TablePagination API
Browse files Browse the repository at this point in the history
changed API to enable key value pairs as 'rows per page options'

removed -1 from default 'rows per page options'
  • Loading branch information
SarthakC committed Oct 15, 2019
1 parent 83f5e19 commit 78bcda7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ export default function CustomPaginationActionsTable() {
<TableFooter>
<TableRow>
<TablePagination
rowsPerPageOptions={[5, 10, 25]}
rowsPerPageOptions={[5, 10, 25, { label: 'All', value: -1 }]}
colSpan={3}
count={rows.length}
rowsPerPage={rowsPerPage}
Expand Down
4 changes: 2 additions & 2 deletions packages/material-ui/src/TablePagination/TablePagination.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,9 @@ const TablePagination = React.forwardRef(function TablePagination(props, ref) {
<MenuItemComponent
className={classes.menuItem}
key={rowsPerPageOption}
value={rowsPerPageOption}
value={rowsPerPageOption.value ? rowsPerPageOption.value : rowsPerPageOption}
>
{rowsPerPageOption}
{rowsPerPageOption.label ? rowsPerPageOption.label : rowsPerPageOption}
</MenuItemComponent>
))}
</Select>
Expand Down

0 comments on commit 78bcda7

Please sign in to comment.