tweak paginationFactory naming

This commit is contained in:
AllenFang
2018-01-20 17:48:22 +08:00
parent 9b933d6df2
commit 9b07be0e80
6 changed files with 10 additions and 8 deletions

View File

@@ -19,10 +19,10 @@
</code></pre>
<h2><a class="anchor" aria-hidden="true" name="how"></a><a href="#how" aria-hidden="true" class="hash-link" ><svg aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>How</h2>
<p>Let's enable a pagination on your table:</p>
<pre><code class="hljs css js"><span class="hljs-keyword">import</span> paginator <span class="hljs-keyword">from</span> <span class="hljs-string">'react-bootstrap-table2-paginator'</span>;
<pre><code class="hljs css js"><span class="hljs-keyword">import</span> paginationFactory <span class="hljs-keyword">from</span> <span class="hljs-string">'react-bootstrap-table2-paginator'</span>;
<span class="hljs-comment">// omit...</span>
&lt;BootstrapTable keyField=<span class="hljs-string">'id'</span> data={ products } columns={ columns } pagination={ paginator() } /&gt;
&lt;BootstrapTable keyField=<span class="hljs-string">'id'</span> data={ products } columns={ columns } pagination={ paginationFactory() } /&gt;
</code></pre>
<h2><a class="anchor" aria-hidden="true" name="customization"></a><a href="#customization" aria-hidden="true" class="hash-link" ><svg aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Customization</h2>
<p>See <a href="./pagination-props.html">pagination props</a></p>

View File

@@ -137,14 +137,14 @@ When <code>loading</code> is <code>true</code>, <code>react-bootstrap-table2</co
<pre><code class="hljs css sh">$ npm install react-bootstrap-table2-paginator --save
</code></pre>
<p>After installation of <code>react-bootstrap-table2-paginator</code>, you can enable pagination on <code>react-bootstrap-table2</code> easily:</p>
<pre><code class="hljs css js"><span class="hljs-keyword">import</span> paginator <span class="hljs-keyword">from</span> <span class="hljs-string">'react-bootstrap-table2-paginator'</span>;
<pre><code class="hljs css js"><span class="hljs-keyword">import</span> paginationFactory <span class="hljs-keyword">from</span> <span class="hljs-string">'react-bootstrap-table2-paginator'</span>;
<span class="hljs-comment">// omit...</span>
&lt;BootstrapTable data={ data } columns={ columns } pagination={ paginator() } /&gt;
&lt;BootstrapTable data={ data } columns={ columns } pagination={ paginationFactory() } /&gt;
</code></pre>
<p><code>paginator</code> is a function actually and allow to pass some pagination options, following we list all the available options:</p>
<pre><code class="hljs css js">paginator({
<p><code>paginationFactory</code> is a function actually and allow to pass some pagination options, following we list all the available options:</p>
<pre><code class="hljs css js">paginationFactory({
page, <span class="hljs-comment">// Specify the current page. It's necessary when remote is enabled</span>
sizePerPage, <span class="hljs-comment">// Specify the size per page. It's necessary when remote is enabled</span>
totalSize, <span class="hljs-comment">// Total data size. It's necessary when remote is enabled</span>

View File

@@ -17,5 +17,5 @@
<body>
<div id="root"></div>
<div id="error-display"></div>
<script type="text/javascript" src="static/preview.09b21807c3ce3a73f063.bundle.js"></script></body>
<script type="text/javascript" src="static/preview.2887657eda69af338aab.bundle.js"></script></body>
</html>

View File

@@ -40,5 +40,5 @@
</head>
<body style="margin: 0;">
<div id="root"></div>
<script type="text/javascript" src="static/manager.409e6bb4d35d448851d2.bundle.js"></script></body>
<script type="text/javascript" src="static/manager.5d5302d3dfda86ea9612.bundle.js"></script></body>
</html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long