From d638eac1de7bfc7b26ccfb102c8a0214e053fc78 Mon Sep 17 00:00:00 2001 From: Matt Date: Fri, 30 Aug 2019 08:17:07 -0700 Subject: [PATCH] Exposes buildOptionText property of Options component to Pagination component. pageSizeBuildOptionText allows the user to define a method to overwrite the default buildOptionText method inside the Option component, allowing for custom text. The motivation for this is to put the data length as the last option in pageSizeOptions and then use this custom method to covert the display text to say "All". --- src/Pagination.jsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Pagination.jsx b/src/Pagination.jsx index 2767a21e..aac3844b 100644 --- a/src/Pagination.jsx +++ b/src/Pagination.jsx @@ -48,6 +48,7 @@ class Pagination extends React.Component { showQuickJumper: PropTypes.oneOfType([PropTypes.bool, PropTypes.object]), showTitle: PropTypes.bool, pageSizeOptions: PropTypes.arrayOf(PropTypes.string), + pageSizeBuildOptionText: PropTypes.func, showTotal: PropTypes.func, locale: PropTypes.object, style: PropTypes.object, @@ -661,6 +662,7 @@ class Pagination extends React.Component { current={this.state.current} pageSize={this.state.pageSize} pageSizeOptions={this.props.pageSizeOptions} + buildOptionText={this.props.pageSizeBuildOptionText} quickGo={this.shouldDisplayQuickJumper() ? this.handleChange : null} goButton={goButton} />