File tree 2 files changed +9
-5
lines changed
2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -930,7 +930,7 @@ BootstrapTable.propTypes = {
930
930
onRowClick : PropTypes . func ,
931
931
page : PropTypes . number ,
932
932
pageStartIndex : PropTypes . number ,
933
- paginationShowsTotal : PropTypes . bool ,
933
+ paginationShowsTotal : PropTypes . oneOfType ( [ PropTypes . bool , PropTypes . func ] ) ,
934
934
sizePerPageList : PropTypes . array ,
935
935
sizePerPage : PropTypes . number ,
936
936
paginationSize : PropTypes . number ,
Original file line number Diff line number Diff line change @@ -78,12 +78,16 @@ class PaginationList extends Component {
78
78
} ) ;
79
79
80
80
const offset = Math . abs ( Const . PAGE_START_INDEX - pageStartIndex ) ;
81
- const total = paginationShowsTotal ? < span >
82
- Showing rows { ( ( currPage - pageStartIndex ) * sizePerPage ) } to  ;
83
- { Math . min ( ( sizePerPage * ( currPage + offset ) - 1 ) , dataSize ) } of
84
- { dataSize }
81
+ const start = ( ( currPage - pageStartIndex ) * sizePerPage ) ;
82
+ const to = Math . min ( ( sizePerPage * ( currPage + offset ) - 1 ) , dataSize ) ;
83
+ let total = paginationShowsTotal ? < span >
84
+ Showing rows { start } to { to } of { dataSize }
85
85
</ span > : null ;
86
86
87
+ if ( typeof paginationShowsTotal === 'function' ) {
88
+ total = paginationShowsTotal ( start , to , dataSize ) ;
89
+ }
90
+
87
91
return (
88
92
< div className = 'row' style = { { marginTop : 15 } } >
89
93
{
You can’t perform that action at this time.
0 commit comments