07 Jul 2023 09:18 PM - edited 07 Jul 2023 09:19 PM
I would like the row per page values to be different than what is there by default [10, 20, 30, 40 ,50]. Is there a way to change this?
Solved! Go to Solution.
09 Jul 2023 09:24 PM
Hi there
Yes, you can change the page size to any value you want. In the following example, I changed the default size to 7:
<DataTable columns={columns} data={data}>
<DataTable.Pagination defaultPageSize={7} />
</DataTable>
Thanks
12 Jul 2023 03:13 PM
Thank you. Is there also a way to change the list of page sizes that can be selected in the drop down list displayed.
18 Jul 2023 07:22 AM
Hi @scott-smith ,
The defaultPageSize also influences the page size dropdown list ("x rows per page"). The specified value will be displayed as the smallest page size value. Furthermore, up to 4 more options will be available in the UI. The default options are 10, 20, 30, 40, and 50. If you specify a defaultPageSize of 7 , the options will automatically be 7, 14, 21, 28, and 35.
Could you let me know if this meets what you're trying to achieve?