[Data Grid] Add hidePerPageOptions prop into EuiDataGridPaginationProps#3700
Conversation
|
Since this is a community submitted pull request, a Jenkins build has not been kicked off automatically. Can an Elastic organization member please verify the contents of this patch and then kick off a build manually? |
chandlerprall
left a comment
There was a problem hiding this comment.
Instead of a new prop for this, I feel making pageSizeOptions optional and/or checking for an empty array is a better approach.
|
Yup, I think that's okay. Our existing component pagination prop types are all largely different between inmemorytable, basictable, tablepagination, and pagination. Not much unity to maintain between them, and supporting an empty pageSizeOptions is probably the better path forward. |
| const pageCount = Math.ceil(props.rowCount / pageSize); | ||
|
|
||
| if (props.rowCount < pageSizeOptions[0]) { | ||
| if (pageCount <= 1) { |
There was a problem hiding this comment.
The reason this was previously props.rowCount < pageSizeOptions[0] is to keep the pagination controls around when switching to a large page size. For example, if there are 30 results and the page options are 5, 25, 50, switching the page size to 50 will cause the controls to disappear.
Maybe, if (props.rowCount < (pageSizeOptions[0] || pageSize)) { instead? Then it uses the active page size if there are no options.
There was a problem hiding this comment.
Thanks for explanation, I didn't think about it at the first sight!
My only concern is: who guarantees the pageSizeOptions will be in ascending order?
An user can pass it like [100, 50, 25], right?
So I also placed a sorting function to be sure.
…ion_hide_per_page # Conflicts: # CHANGELOG.md
chandlerprall
left a comment
There was a problem hiding this comment.
One more request :)
…ion_hide_per_page # Conflicts: # CHANGELOG.md
|
jenkins test this |
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_3700/ |


Summary
Add
hidePerPageOptions prop intoEuiDataGridPaginationPropsforEuiDataGridpagination prop:In kibana
Data tablevisualization theRows per pageis controlled by vis options tab, so it needs a possibility to hide choosing rows per page.Checklist