From 964faa53e363a4b54431c0786fc7c31eddc7d799 Mon Sep 17 00:00:00 2001 From: AllenFang Date: Thu, 7 Feb 2019 13:56:42 +0800 Subject: [PATCH] fix wrong storyb code --- .../custome-page-list-with-filter.js | 73 +++++++++++++++---- 1 file changed, 57 insertions(+), 16 deletions(-) diff --git a/packages/react-bootstrap-table2-example/examples/pagination/custome-page-list-with-filter.js b/packages/react-bootstrap-table2-example/examples/pagination/custome-page-list-with-filter.js index 9c7279d..eefd780 100644 --- a/packages/react-bootstrap-table2-example/examples/pagination/custome-page-list-with-filter.js +++ b/packages/react-bootstrap-table2-example/examples/pagination/custome-page-list-with-filter.js @@ -3,7 +3,6 @@ import React from 'react'; import BootstrapTable from 'react-bootstrap-table-next'; import paginationFactory, { PaginationProvider, PaginationListStandalone } from 'react-bootstrap-table2-paginator'; -import cellEditFactory from 'react-bootstrap-table2-editor'; import filterFactory, { textFilter } from 'react-bootstrap-table2-filter'; import Code from 'components/common/code-block'; import { productsGenerator } from 'utils/common'; @@ -22,22 +21,10 @@ const columns = [{ const sourceCode = `\ import BootstrapTable from 'react-bootstrap-table-next'; -import paginationFactory from 'react-bootstrap-table2-paginator'; +import paginationFactory, { PaginationProvider, PaginationListStandalone } from 'react-bootstrap-table2-paginator'; +import filterFactory, { textFilter } from 'react-bootstrap-table2-filter'; -const columns = [{ - dataField: 'id', - text: 'Product ID', - filter: textFilter({}) -}, { - dataField: 'name', - text: 'Product Name', - filter: textFilter() -}]; - - -`; - -export default class Table extends React.Component { +class Table extends React.Component { render() { const options = { custom: true, @@ -90,3 +77,57 @@ export default class Table extends React.Component { ); } } +`; + +export default class Table extends React.Component { + render() { + const options = { + custom: true, + paginationSize: 4, + pageStartIndex: 1, + firstPageText: 'First', + prePageText: 'Back', + nextPageText: 'Next', + lastPageText: 'Last', + nextPageTitle: 'First page', + prePageTitle: 'Pre page', + firstPageTitle: 'Next page', + lastPageTitle: 'Last page', + showTotal: true, + totalSize: products.length + }; + const contentTable = ({ paginationProps, paginationTableProps }) => ( +
+ +
+
+ +
+
+ +
+ ); + + return ( +
+

PaginationProvider will care the data size change. You dont do anything

+ + { contentTable } + + { sourceCode } +
+ ); + } +}