Does the Ant Design Table controller take a Pagination component, instead of a plain object of properties. I need to add a switcher, to switch between rows per page.
Currently it is implemented in the Pagination component.
Rows can be selectable by making first column as a selectable column. You can use rowSelection.type to set selection type. Default is checkbox . selection happens when clicking checkbox by default.
You can make use of the responsive property on the column that you want to control for screen sizes. Just add a From To column with a custom render function, and set the responsive property on that column to only show on xs screens. The From and To columns will have the responsive property set to show on md and above.
If what you need is only the ability to select the number of rows per page, then the following code should work for you:
<Table
dataSource={...}
pagination={{ defaultPageSize: 10, showSizeChanger: true, pageSizeOptions: ['10', '20', '30']}}
>
Basically wrapping the Pagination props into a pagination object, and pass it into your Table component.
If you need more customization you might want to consider turning the default Table pagination off and hook up your custom pagination component. Sample code:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With