Monday, June 3, 2024
 Popular · Latest · Hot · Upcoming
67
rated 0 times [  68] [ 1]  / answers: 1 / hits: 51392  / 6 Years ago, tue, august 14, 2018, 12:00:00

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.


More From » reactjs

 Answers
1

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:


Edit


[#53733] Friday, August 10, 2018, 6 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
sonja

Total Points: 541
Total Questions: 113
Total Answers: 114

Location: Anguilla
Member since Sun, Jan 29, 2023
1 Year ago
sonja questions
Mon, Nov 30, 20, 00:00, 4 Years ago
Sun, Oct 11, 20, 00:00, 4 Years ago
Thu, May 21, 20, 00:00, 4 Years ago
Sun, Nov 10, 19, 00:00, 5 Years ago
Mon, Aug 26, 19, 00:00, 5 Years ago
;