Skip to content

Commit d638eac

Browse files
author
Matt
committed
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".
1 parent f33c0f1 commit d638eac

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/Pagination.jsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ class Pagination extends React.Component {
4848
showQuickJumper: PropTypes.oneOfType([PropTypes.bool, PropTypes.object]),
4949
showTitle: PropTypes.bool,
5050
pageSizeOptions: PropTypes.arrayOf(PropTypes.string),
51+
pageSizeBuildOptionText: PropTypes.func,
5152
showTotal: PropTypes.func,
5253
locale: PropTypes.object,
5354
style: PropTypes.object,
@@ -661,6 +662,7 @@ class Pagination extends React.Component {
661662
current={this.state.current}
662663
pageSize={this.state.pageSize}
663664
pageSizeOptions={this.props.pageSizeOptions}
665+
buildOptionText={this.props.pageSizeBuildOptionText}
664666
quickGo={this.shouldDisplayQuickJumper() ? this.handleChange : null}
665667
goButton={goButton}
666668
/>

0 commit comments

Comments
 (0)