mirror of
https://github.com/gosticks/react-bootstrap-table2.git
synced 2025-10-16 11:55:39 +00:00
* updated test for pagination fix * suspected bug in page.js Local pagination aligning returns start page when eg editing cell locally. This results in state change, too. Not really getting the purpose of the original idea. Please consider this modification. It only checks if page fits in the data size range. As I saw, this alignment only affects local pagination, not remote. * modified fix w/ pageStartIndex I forgot to mind pageStartIndex |
||
|---|---|---|
| .. | ||
| src | ||
| style | ||
| test | ||
| index.js | ||
| package.json | ||
| README.md | ||
react-bootstrap-table2-paginator
react-bootstrap-table2 separate the pagination code base to react-bootstrap-table2-paginator, so there's a little bit different when you use pagination. In the following, we are going to show you how to enable and configure the a pagination table
Install
$ npm install react-bootstrap-table2-paginator --save
Add CSS
// es5
require('react-bootstrap-table2-paginator/dist/react-bootstrap-table2-paginator.min.css');
// es6
import 'react-bootstrap-table2-paginator/dist/react-bootstrap-table2-paginator.min.css';
How
Let's enable a pagination on your table:
import paginationFactory from 'react-bootstrap-table2-paginator';
// omit...
<BootstrapTable keyField='id' data={ products } columns={ columns } pagination={ paginationFactory() } />
Customization
See pagination props