Skip to content

Commit 7c88a3b

Browse files
committed
fix #487
1 parent 10a3a0b commit 7c88a3b

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

src/BootstrapTable.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -724,7 +724,8 @@ class BootstrapTable extends Component {
724724
prePage={ options.prePage || Const.PRE_PAGE }
725725
nextPage={ options.nextPage || Const.NEXT_PAGE }
726726
firstPage={ options.firstPage || Const.FIRST_PAGE }
727-
lastPage={ options.lastPage || Const.LAST_PAGE } />
727+
lastPage={ options.lastPage || Const.LAST_PAGE }
728+
hideSizePerPage={ options.hideSizePerPage }/>
728729
</div>
729730
);
730731
}
@@ -941,6 +942,7 @@ BootstrapTable.propTypes = {
941942
sizePerPageList: PropTypes.array,
942943
sizePerPage: PropTypes.number,
943944
paginationSize: PropTypes.number,
945+
hideSizePerPage: PropTypes.bool,
944946
onSortChange: PropTypes.func,
945947
onPageChange: PropTypes.func,
946948
onSizePerPageList: PropTypes.func,
@@ -1029,6 +1031,7 @@ BootstrapTable.defaultProps = {
10291031
sizePerPageList: Const.SIZE_PER_PAGE_LIST,
10301032
sizePerPage: undefined,
10311033
paginationSize: Const.PAGINATION_SIZE,
1034+
hideSizePerPage: false,
10321035
onSizePerPageList: undefined,
10331036
noDataText: undefined,
10341037
handleConfirmDeleteRow: undefined,

src/pagination/PaginationList.js

+9-3
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ class PaginationList extends Component {
5555
sizePerPage,
5656
sizePerPageList,
5757
paginationShowsTotal,
58-
pageStartIndex
58+
pageStartIndex,
59+
hideSizePerPage
5960
} = this.props;
6061

6162
this.totalPages = Math.ceil(dataSize / sizePerPage);
@@ -88,14 +89,18 @@ class PaginationList extends Component {
8889
total = paginationShowsTotal(start, to, dataSize);
8990
}
9091

92+
const dropDownStyle = {
93+
visibility: hideSizePerPage ? 'hidden' : 'visible'
94+
};
95+
9196
return (
9297
<div className='row' style={ { marginTop: 15 } }>
9398
{
9499
sizePerPageList.length > 1
95100
? <div>
96101
<div className='col-md-6'>
97102
{ total }{ ' ' }
98-
<span className='dropdown'>
103+
<span className='dropdown' style={ dropDownStyle }>
99104
<button className='btn btn-default dropdown-toggle'
100105
type='button' id='pageDropDown' data-toggle='dropdown'
101106
aria-expanded='true'>
@@ -207,7 +212,8 @@ PaginationList.propTypes = {
207212
remote: PropTypes.bool,
208213
onSizePerPageList: PropTypes.func,
209214
prePage: PropTypes.string,
210-
pageStartIndex: PropTypes.number
215+
pageStartIndex: PropTypes.number,
216+
hideSizePerPage: PropTypes.bool
211217
};
212218

213219
PaginationList.defaultProps = {

0 commit comments

Comments
 (0)