Skip to content

Commit

Permalink
[TablePagination] Allow more rows per pages
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari committed Nov 7, 2018
1 parent 4eeb7a2 commit 4952c38
Show file tree
Hide file tree
Showing 8 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ class CustomPaginationActionsTable extends React.Component {
<TableFooter>
<TableRow>
<TablePagination
rowsPerPageOptions={[5, 10, 25]}
colSpan={3}
count={rows.length}
rowsPerPage={rowsPerPage}
Expand Down
1 change: 1 addition & 0 deletions docs/src/pages/demos/tables/EnhancedTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,7 @@ class EnhancedTable extends React.Component {
</Table>
</div>
<TablePagination
rowsPerPageOptions={[5, 10, 25]}
component="div"
count={data.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 @@ -9,7 +9,7 @@ import Select from '../Select';
import TableCell from '../TableCell';
import Toolbar from '../Toolbar';
import Typography from '../Typography';
import TablePaginationActions from '../TablePaginationActions';
import TablePaginationActions from './TablePaginationActions';

export const styles = theme => ({
/* Styles applied to the root element. */
Expand Down Expand Up @@ -237,7 +237,7 @@ TablePagination.defaultProps = {
component: TableCell,
labelDisplayedRows: ({ from, to, count }) => `${from}-${to} of ${count}`,
labelRowsPerPage: 'Rows per page:',
rowsPerPageOptions: [5, 10, 25],
rowsPerPageOptions: [10, 25, 50, 100],
};

export default withStyles(styles, { name: 'MuiTablePagination' })(TablePagination);
2 changes: 0 additions & 2 deletions packages/material-ui/src/TablePaginationActions/index.d.ts

This file was deleted.

1 change: 0 additions & 1 deletion packages/material-ui/src/TablePaginationActions/index.js

This file was deleted.

2 changes: 1 addition & 1 deletion pages/api/table-pagination.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ A `TableCell` based component for placing inside `TableFooter` for pagination.
| <span class="prop-name">onChangeRowsPerPage</span> | <span class="prop-type">func</span> |   | Callback fired when the number of rows per page is changed.<br><br>**Signature:**<br>`function(event: object) => void`<br>*event:* The event source of the callback |
| <span class="prop-name required">page *</span> | <span class="prop-type">number</span> |   | The zero-based index of the current page. |
| <span class="prop-name required">rowsPerPage *</span> | <span class="prop-type">number</span> |   | The number of rows per page. |
| <span class="prop-name">rowsPerPageOptions</span> | <span class="prop-type">array</span> | <span class="prop-default">[5, 10, 25]</span> | Customizes the options of the rows per page select field. If less than two options are available, no select field will be displayed. |
| <span class="prop-name">rowsPerPageOptions</span> | <span class="prop-type">array</span> | <span class="prop-default">[10, 25, 50, 100]</span> | Customizes the options of the rows per page select field. If less than two options are available, no select field will be displayed. |
| <span class="prop-name">SelectProps</span> | <span class="prop-type">object</span> |   | Properties applied to the rows per page [`Select`](/api/select/) element. |

Any other properties supplied will be spread to the root element ([TableCell](/api/table-cell/)).
Expand Down

0 comments on commit 4952c38

Please sign in to comment.