From 48004e1cb53753acb079385315902e19fb1fc905 Mon Sep 17 00:00:00 2001 From: Chun-MingChen Date: Sun, 10 Dec 2017 20:41:58 +0800 Subject: [PATCH 1/2] patch for pagination document * required props for remote mode --- docs/README.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/docs/README.md b/docs/README.md index 2178334..eb1149d 100644 --- a/docs/README.md +++ b/docs/README.md @@ -189,7 +189,19 @@ paginator({ firstPageTitle: 'Go to first', // the title of first page button lastPageTitle: 'Go to last', // the title of last page button hideSizePerPage: true, // hide the size per page dorpdown - hidePageListOnlyOnePage: true// hide pagination bar when only one page, default is false + hidePageListOnlyOnePage: true, // hide pagination bar when only one page, default is false + onPageChange: (page, sizePerPage) => {}, // callback function when page was changing + onSizePerPageChange: (sizePerPage, page) => {}, // callback function when page size was changing +}) +``` + +When [`remote`](#remote) was enabled, the following **3** arguments were required. + +```js +paginator({ + page, // Indicate the current page number. + sizePerPage, // Indicate how many rows per page. + totalSize, // Total size of table rows. }) ``` From 472f5d887c012ed082d7e6a5ae57de28a154178a Mon Sep 17 00:00:00 2001 From: Chun-MingChen Date: Sat, 16 Dec 2017 13:36:23 +0800 Subject: [PATCH 2/2] layout and wording beautify --- docs/README.md | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/docs/README.md b/docs/README.md index eb1149d..2a334c1 100644 --- a/docs/README.md +++ b/docs/README.md @@ -169,6 +169,9 @@ import paginator from 'react-bootstrap-table2-paginator'; ```js paginator({ + page, // Specify the current page. It's necessary when remote is enabled + sizePerPage, // Specify the size per page. It's necessary when remote is enabled + totalSize, // Total data size. It's necessary when remote is enabled pageStartIndex: 0, // first page will be 0, default is 1 paginationSize: 3, // the pagination bar size, default is 5 sizePerPageList: [ { @@ -195,16 +198,6 @@ paginator({ }) ``` -When [`remote`](#remote) was enabled, the following **3** arguments were required. - -```js -paginator({ - page, // Indicate the current page number. - sizePerPage, // Indicate how many rows per page. - totalSize, // Total size of table rows. -}) -``` - ### onTableChange - [Function] This callback function will be called when [`remote`](#remote) enabled only.