mirror of
https://github.com/gosticks/react-bootstrap-table2.git
synced 2026-08-16 21:50:17 +00:00
20181225 release
This commit is contained in:
+164
-1
@@ -26,5 +26,168 @@
|
||||
<BootstrapTable keyField=<span class="hljs-string">'id'</span> data={ products } columns={ columns } pagination={ paginationFactory() } />
|
||||
</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>
|
||||
<h3><a class="anchor" aria-hidden="true" name="basic-customization"></a><a href="#basic-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>Basic Customization</h3>
|
||||
<p><code>react-bootstrap-table2</code> give some simple ways to customize something like text, styling etc, following is all the props we support for basic customization:</p>
|
||||
<ul>
|
||||
<li><a href="./pagination-props.html#paginationpaginationsize-number">paginationSize</a></li>
|
||||
<li><a href="./pagination-props.html#paginationsizeperpagelist-array">sizePerPageList</a></li>
|
||||
<li><a href="./pagination-props.html#paginationwithfirstandlast-bool">withFirstAndLast</a></li>
|
||||
<li><a href="./pagination-props.html#paginationalwaysshowallbtns-bool">alwaysShowAllBtns</a></li>
|
||||
<li><a href="./pagination-props.html#paginationfirstpagetext-any">firstPageText</a></li>
|
||||
<li><a href="./pagination-props.html#paginationprepagetext-any">prePageText</a></li>
|
||||
<li><a href="./pagination-props.html#paginationnextpagetext-any">nextPageText</a></li>
|
||||
<li><a href="./pagination-props.html#paginationlastpagetext-any">lastPageText</a></li>
|
||||
<li><a href="./pagination-props.html#paginationfirstpagetitle-any">firstPageTitle</a></li>
|
||||
<li><a href="./pagination-props.html#paginationprepagetitle-any">prePageTitle</a></li>
|
||||
<li><a href="./pagination-props.html#paginationnextpagetitle-any">nextPageTitle</a></li>
|
||||
<li><a href="./pagination-props.html#paginationlastpagetitle-any">lastPageTitle</a></li>
|
||||
<li><a href="./pagination-props.html#paginationhidesizeperpage-bool">hideSizePerPage</a></li>
|
||||
<li><a href="./pagination-props.html#paginationhidepagelistonlyonepage-bool">hidePageListOnlyOnePage</a></li>
|
||||
<li><a href="./pagination-props.html#paginationshowtotal-bool">showTotal</a></li>
|
||||
</ul>
|
||||
<p>You can check <a href="https://react-bootstrap-table.github.io/react-bootstrap-table2/storybook/index.html?selectedKind=Pagination&selectedStory=Custom%20Pagination&full=0&addons=1&stories=1&panelRight=0&addonPanel=storybook%2Factions%2Factions-panel">this online demo</a> for above props usage.</p>
|
||||
<h3><a class="anchor" aria-hidden="true" name="advance-customization"></a><a href="#advance-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>Advance Customization</h3>
|
||||
<p>Sometime, you may feel above props is not satisfied with your requirement, don't worry, we provide following renderer for each part of pagination:</p>
|
||||
<ul>
|
||||
<li><a href="./pagination-props.html#paginationpagelistrenderer-function">pageListRenderer</a></li>
|
||||
<li><a href="./pagination-props.html#paginationpagebuttonrenderer-function">pageButtonRenderer</a></li>
|
||||
<li><a href="./pagination-props.html#paginationsizeperpagerenderer-function">sizePerPageRenderer</a></li>
|
||||
<li><a href="./pagination-props.html#paginationsizeperpageoptionrenderer-function">sizePerPageOptionRenderer</a></li>
|
||||
<li><a href="./pagination-props.html#paginationpaginationtotalrenderer-function">paginationTotalRenderer</a></li>
|
||||
</ul>
|
||||
<h3><a class="anchor" aria-hidden="true" name="completely-customization"></a><a href="#completely-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>Completely Customization</h3>
|
||||
<p>If you want to customize the pagination component completely, you may get interesting on following solution:</p>
|
||||
<ul>
|
||||
<li>Standalone</li>
|
||||
<li>Non-standalone</li>
|
||||
</ul>
|
||||
<p><code>react-bootstrap-table2-paginator</code> have a <code>PaginationProvider</code> which is a react context and you will be easier to customize the pagination components under the scope of <code>PaginationProvider</code>. Let's introduce it step by step:</p>
|
||||
<h4><a class="anchor" aria-hidden="true" name="import-paginationprovider"></a><a href="#import-paginationprovider" 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>Import PaginationProvider</h4>
|
||||
<pre><code class="hljs css js"><span class="hljs-keyword">import</span> paginationFactory, { PaginationProvider } <span class="hljs-keyword">from</span> <span class="hljs-string">'react-bootstrap-table2-paginator'</span>;
|
||||
|
||||
</code></pre>
|
||||
<h4><a class="anchor" aria-hidden="true" name="declare-custom-and-totalsize-in-pagination-option"></a><a href="#declare-custom-and-totalsize-in-pagination-option" 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>Declare custom and totalSize in pagination option:</h4>
|
||||
<pre><code class="hljs css js"><span class="hljs-keyword">const</span> paginationOption = {
|
||||
<span class="hljs-attr">custom</span>: <span class="hljs-literal">true</span>,
|
||||
<span class="hljs-attr">totalSize</span>: products.length
|
||||
};
|
||||
</code></pre>
|
||||
<h4><a class="anchor" aria-hidden="true" name="render-paginationprovider"></a><a href="#render-paginationprovider" 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>Render PaginationProvider</h4>
|
||||
<pre><code class="hljs css js"><PaginationProvider
|
||||
pagination={ paginationFactory(options) }
|
||||
>
|
||||
{
|
||||
({
|
||||
paginationProps,
|
||||
paginationTableProps
|
||||
}) => (
|
||||
.....
|
||||
)
|
||||
}
|
||||
</PaginationProvider>
|
||||
</code></pre>
|
||||
<p><code>PaginationProvider</code> actually is a wrapper for the consumer of react context so that you are able to get the props from context then render to your compoennt and <code>BootstrapTable</code>:</p>
|
||||
<ul>
|
||||
<li><code>paginationProps</code>: this include everything about pagination, you will use it when you render standalone component or your custom component.</li>
|
||||
<li><code>paginationTableProps</code>: you don't need to know about this, but you have to give it as props when render <code>BootstrapTable</code>.</li>
|
||||
</ul>
|
||||
<p>So far, your customization pagination should look like it:</p>
|
||||
<pre><code class="hljs css js"><PaginationProvider
|
||||
pagination={ paginationFactory(options) }
|
||||
>
|
||||
{
|
||||
({
|
||||
paginationProps,
|
||||
paginationTableProps
|
||||
}) => (
|
||||
<span class="xml"><span class="hljs-tag"><<span class="hljs-name">div</span>></span>
|
||||
<span class="hljs-tag"><<span class="hljs-name">BootstrapTable</span>
|
||||
<span class="hljs-attr">keyField</span>=<span class="hljs-string">"id"</span>
|
||||
<span class="hljs-attr">data</span>=<span class="hljs-string">{</span> <span class="hljs-attr">products</span> }
|
||||
<span class="hljs-attr">columns</span>=<span class="hljs-string">{</span> <span class="hljs-attr">columns</span> }
|
||||
{ <span class="hljs-attr">...paginationTableProps</span> }
|
||||
/></span>
|
||||
<span class="hljs-tag"></<span class="hljs-name">div</span>></span>
|
||||
)
|
||||
}
|
||||
<span class="hljs-tag"></<span class="hljs-name">PaginationProvider</span>></span></span>
|
||||
</code></pre>
|
||||
<p>Now, you have two choices</p>
|
||||
<ul>
|
||||
<li>Use built-in standalne components</li>
|
||||
<li>Customize everything by yourself</li>
|
||||
</ul>
|
||||
<h4><a class="anchor" aria-hidden="true" name="use-standalone-component"></a><a href="#use-standalone-component" 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>Use Standalone Component</h4>
|
||||
<p><code>react-bootstrap-table2-paginator</code> provider two standalone components:</p>
|
||||
<ul>
|
||||
<li>Size Per Page Dropdwn Standalone</li>
|
||||
<li>Pagination List Standalone</li>
|
||||
</ul>
|
||||
<p>When render each standalone, you just need to pass the <code>paginationProps</code> props to standalone component:</p>
|
||||
<pre><code class="hljs css js"><span class="hljs-keyword">import</span> paginationFactory, { PaginationProvider, PaginationListStandalone, SizePerPageDropdownStandalone } <span class="hljs-keyword">from</span> <span class="hljs-string">'react-bootstrap-table2-paginator'</span>;
|
||||
|
||||
<PaginationProvider
|
||||
pagination={ paginationFactory(options) }
|
||||
>
|
||||
{
|
||||
({
|
||||
paginationProps,
|
||||
paginationTableProps
|
||||
}) => (
|
||||
<div>
|
||||
<SizePerPageDropdownStandalone
|
||||
{ ...paginationProps }
|
||||
/>
|
||||
<BootstrapTable
|
||||
keyField="id"
|
||||
data={ products }
|
||||
columns={ columns }
|
||||
{ ...paginationTableProps }
|
||||
/>
|
||||
<PaginationListStandalone
|
||||
{ ...paginationProps }
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
</PaginationProvider>
|
||||
</code></pre>
|
||||
<p>That's it!! The benifit for using standalone is you can much easier to render the standalone component in any posistion. In the future, we will implement more featue like applying <code>style</code>, <code>className</code> etc on standalone components.</p>
|
||||
<h4><a class="anchor" aria-hidden="true" name="customization-everything"></a><a href="#customization-everything" 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 Everything</h4>
|
||||
<p>If you choose to custom the pagination component by yourself, the <code>paginationProps</code> will be important for you. Becasue you have to know for example how to change page or what's the current page etc. Therefore, following is all the props in <code>paginationProps</code> object:</p>
|
||||
<pre><code class="hljs css js">page,
|
||||
sizePerPage,
|
||||
pageStartIndex,
|
||||
hidePageListOnlyOnePage,
|
||||
hideSizePerPage,
|
||||
alwaysShowAllBtns,
|
||||
withFirstAndLast,
|
||||
dataSize,
|
||||
sizePerPageList,
|
||||
paginationSize,
|
||||
showTotal,
|
||||
pageListRenderer,
|
||||
pageButtonRenderer,
|
||||
sizePerPageRenderer,
|
||||
paginationTotalRenderer,
|
||||
sizePerPageOptionRenderer,
|
||||
firstPageText,
|
||||
prePageText,
|
||||
nextPageText,
|
||||
lastPageText,
|
||||
prePageTitle,
|
||||
nextPageTitle,
|
||||
firstPageTitle,
|
||||
lastPageTitle,
|
||||
onPageChange,
|
||||
onSizePerPageChange
|
||||
</code></pre>
|
||||
<p>In most of case, <code>page</code>, <code>sizePerPage</code>, <code>onPageChange</code> and <code>onSizePerPageChange</code> are most important propertoes for you:</p>
|
||||
<ul>
|
||||
<li><code>page</code>: Current page.</li>
|
||||
<li><code>sizePerPage</code>: Current size per page.</li>
|
||||
<li><code>onPageChange</code>: Call it when you nede to change page. This function accept one number argument which indicate the new page</li>
|
||||
<li><code>onSizePerPageChange</code>: Call it when you nede to change size per page. This function accept two number argument which indicate the new sizePerPage and new page</li>
|
||||
</ul>
|
||||
<p><a href="https://react-bootstrap-table.github.io/react-bootstrap-table2/storybook/index.html?selectedKind=Pagination&selectedStory=Fully%20Custom%20Pagination&full=0&addons=1&stories=1&panelRight=0&addonPanel=storybook%2Factions%2Factions-panel">This</a> is a online example for showing how to custom pagination completely.</p>
|
||||
</span></div></article></div><div class="docs-prevnext"><a class="docs-prev button" href="basic-celledit.html">← Cell Edit</a><a class="docs-next button" href="basic-row-expand.html">Expandable Row →</a></div></div></div></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/react-bootstrap-table2/" class="nav-home"></a><div><h5>Docs</h5><a href="/react-bootstrap-table2/docs/en/getting-started.html">Getting Started</a><a href="/react-bootstrap-table2/docs/en/table-props.html">API References</a></div><div><h5>Community</h5><a href="https://stackoverflow.com/questions/tagged/react-bootstrap-table" target="_blank">Stack Overflow</a><a href="https://discordapp.com/">Project Chat</a><a href="https://twitter.com/" target="_blank">Twitter</a></div><div><h5>More</h5><a href="/react-bootstrap-table2/blog/index.html">Blog</a><a href="https://github.com/react-bootstrap-table/react-bootstrap-table2">GitHub</a><a class="github-button" href="https://github.com/react-bootstrap-table/react-bootstrap-table2" data-icon="octicon-star" data-count-href="/facebook/docusaurus/stargazers" data-show-count="true" data-count-aria-label="# stargazers on GitHub" aria-label="Star this project on GitHub">Star</a></div></section><section class="copyright">Copyright © 2018 react-bootstrap-table2.</section></footer></div></body></html>
|
||||
+1
-1
@@ -108,7 +108,7 @@ Please see <a href="./cell-edit-props.html">available cell edit configurations</
|
||||
<p>Please see <a href="./basic-pagination.html">Work with pagination</a>.<br>
|
||||
Please see <a href="./pagination-props.html">available pagination configurations</a>.</p>
|
||||
<p>Remember to install <a href="https://www.npmjs.com/package/react-bootstrap-table2-paginator"><code>react-bootstrap-table2-paginator</code></a> firstly.</p>
|
||||
<p>No big changes for pagination, but still can't custom the pagination list, button and sizePerPage dropdown.</p>
|
||||
<p>Until newest <code>react-bootstrap-table2-paginator@2.0.0</code>, we allow you to custom any part of pagination component more flexible.</p>
|
||||
<h2><a class="anchor" aria-hidden="true" name="table-search"></a><a href="#table-search" 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>Table Search</h2>
|
||||
<p>Please see <a href="./basic-search.html">Work with table search</a>.<br>
|
||||
Please see <a href="./search-props.html">Search configurations</a>.</p>
|
||||
|
||||
+152
-1
@@ -18,6 +18,7 @@
|
||||
<p><strong>NONE</strong></p>
|
||||
<h2><a class="anchor" aria-hidden="true" name="optional"></a><a href="#optional" 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>Optional</h2>
|
||||
<ul>
|
||||
<li><a href="#paginationcustom-bool">custom</a></li>
|
||||
<li><a href="#paginationpage-number">page</a></li>
|
||||
<li><a href="#paginationsizeperpage-number">sizePerPage</a></li>
|
||||
<li><a href="#paginationtotalsize-number">totalSize</a></li>
|
||||
@@ -39,9 +40,15 @@
|
||||
<li><a href="#paginationonpagechange-function">onPageChange</a></li>
|
||||
<li><a href="#paginationonsizeperpagechange-function">onSizePerPageChange</a></li>
|
||||
<li><a href="#paginationshowtotal-bool">showTotal</a></li>
|
||||
<li><a href="#paginationpagebuttonrenderer-function">pageButtonRenderer</a></li>
|
||||
<li><a href="#paginationpagelistrenderer-function">pageListRenderer</a></li>
|
||||
<li><a href="#paginationsizeperpagerenderer-function">sizePerPageRenderer</a></li>
|
||||
<li><a href="#paginationsizeperpageoptionrenderer-function">sizePerPageOptionRenderer</a></li>
|
||||
<li><a href="#paginationpaginationtotalrenderer-function">paginationTotalRenderer</a></li>
|
||||
</ul>
|
||||
<hr>
|
||||
<h2><a class="anchor" aria-hidden="true" name="paginationcustom-bool"></a><a href="#paginationcustom-bool" 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>pagination.custom - [Bool]</h2>
|
||||
<p>Default is false, you will enable it only when you need to implement a <a href="./basic-pagination.html#completely-customization">customization completely</a>.</p>
|
||||
<h2><a class="anchor" aria-hidden="true" name="paginationpage-number"></a><a href="#paginationpage-number" 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>pagination.page - [Number]</h2>
|
||||
<p>Use <code>pagination.page</code> specify the current page when table render.</p>
|
||||
<blockquote>
|
||||
@@ -53,7 +60,11 @@
|
||||
<p>It's necessary value when <a href="./table-props.html#remote-bool-object">remote</a> pagination is enabled.</p>
|
||||
</blockquote>
|
||||
<h2><a class="anchor" aria-hidden="true" name="paginationtotalsize-number"></a><a href="#paginationtotalsize-number" 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>pagination.totalSize - [Number]</h2>
|
||||
<p>It's only work for <a href="./table-props.html#remote-bool-object">remote</a> mode, because <code>react-bootstrap-table2</code> will never know the totally data size actually. Remeber to assign <code>totalSize</code> when you enable the remote pagination.</p>
|
||||
<p>This props will be necessary value for below two cases:</p>
|
||||
<h3><a class="anchor" aria-hidden="true" name="remote-mode"></a><a href="#remote-mode" 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>remote mode</h3>
|
||||
<p>Because <code>react-bootstrap-table2</code> will never know the totally data size actually. Remeber to assign <code>totalSize</code> when you enable the remote pagination.</p>
|
||||
<h3><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</h3>
|
||||
<p>When you need to implement a <a href="./basic-pagination.html#completely-customization">customization completely</a>. You have to give props.</p>
|
||||
<h2><a class="anchor" aria-hidden="true" name="paginationpagestartindex-number"></a><a href="#paginationpagestartindex-number" 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>pagination.pageStartIndex - [Number]</h2>
|
||||
<p>Default is <strong>1</strong>, which means the first page index is start from 1. If your first page want to start from <strong>0</strong>, you can control it via <code>pageStartIndex</code>.</p>
|
||||
<h2><a class="anchor" aria-hidden="true" name="paginationpaginationsize-number"></a><a href="#paginationpaginationsize-number" 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>pagination.paginationSize - [Number]</h2>
|
||||
@@ -94,6 +105,146 @@
|
||||
<p>You can hide the pagination when there's only one page in table. Default is <code>false</code>.</p>
|
||||
<h2><a class="anchor" aria-hidden="true" name="paginationshowtotal-bool"></a><a href="#paginationshowtotal-bool" 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>pagination.showTotal - [Bool]</h2>
|
||||
<p>Default is <code>false</code>, if enable will display a text to indicate the row range of current page.</p>
|
||||
<h2><a class="anchor" aria-hidden="true" name="paginationpagebuttonrenderer-function"></a><a href="#paginationpagebuttonrenderer-function" 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>pagination.pageButtonRenderer - [Function]</h2>
|
||||
<p>Custom the page button inside the pagination list. This callback function have one argument which is an object and contain following props:</p>
|
||||
<ul>
|
||||
<li><code>page</code>: Page number</li>
|
||||
<li><code>active</code>: If this page is current page or not.</li>
|
||||
<li><code>disable</code>: If this page is disabled or not.</li>
|
||||
<li><code>title</code>: Page title</li>
|
||||
<li><code>onPageChange</code>: Call it when you need to change page</li>
|
||||
</ul>
|
||||
<p>Following is a minimal example:</p>
|
||||
<pre><code class="hljs css js"><span class="hljs-keyword">const</span> pageButtonRenderer = ({
|
||||
page,
|
||||
active,
|
||||
disable,
|
||||
title,
|
||||
onPageChange
|
||||
}) => {
|
||||
<span class="hljs-keyword">const</span> handleClick = <span class="hljs-function">(<span class="hljs-params">e</span>) =></span> {
|
||||
e.preventDefault();
|
||||
onPageChange(page);
|
||||
};
|
||||
<span class="hljs-comment">// ....</span>
|
||||
<span class="hljs-keyword">return</span> (
|
||||
<span class="xml"><span class="hljs-tag"><<span class="hljs-name">li</span> <span class="hljs-attr">className</span>=<span class="hljs-string">"page-item"</span>></span>
|
||||
<span class="hljs-tag"><<span class="hljs-name">a</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"#"</span> <span class="hljs-attr">onClick</span>=<span class="hljs-string">{</span> <span class="hljs-attr">handleClick</span> } <span class="hljs-attr">....</span>></span>{ page }<span class="hljs-tag"></<span class="hljs-name">a</span>></span>
|
||||
<span class="hljs-tag"></<span class="hljs-name">li</span>></span></span>
|
||||
);
|
||||
};
|
||||
|
||||
<span class="hljs-keyword">const</span> options = {
|
||||
pageButtonRenderer
|
||||
};
|
||||
|
||||
<span class="xml"><span class="hljs-tag"><<span class="hljs-name">BootstrapTable</span> <span class="hljs-attr">keyField</span>=<span class="hljs-string">"id"</span> <span class="hljs-attr">data</span>=<span class="hljs-string">{</span> <span class="hljs-attr">products</span> } <span class="hljs-attr">columns</span>=<span class="hljs-string">{</span> <span class="hljs-attr">columns</span> } <span class="hljs-attr">pagination</span>=<span class="hljs-string">{</span> <span class="hljs-attr">paginationFactory</span>(<span class="hljs-attr">options</span>) } /></span>
|
||||
</span></code></pre>
|
||||
<h2><a class="anchor" aria-hidden="true" name="paginationpagelistrenderer-function"></a><a href="#paginationpagelistrenderer-function" 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>pagination.pageListRenderer - [Function]</h2>
|
||||
<p>Custom the pagination list component, this callback function have one argument which is an object and contain following props:</p>
|
||||
<ul>
|
||||
<li><code>pages</code>: Current page</li>
|
||||
<li><code>onPageChange</code>: Call it when you need to change page</li>
|
||||
</ul>
|
||||
<p>Below is a minimal example:</p>
|
||||
<pre><code class="hljs css js"><span class="hljs-keyword">const</span> pageListRenderer = ({
|
||||
pages,
|
||||
onPageChange
|
||||
}) => {
|
||||
<span class="hljs-comment">// just exclude <, <<, >>, ></span>
|
||||
<span class="hljs-keyword">const</span> pageWithoutIndication = pages.filter(<span class="hljs-function"><span class="hljs-params">p</span> =></span> <span class="hljs-keyword">typeof</span> p.page !== <span class="hljs-string">'string'</span>);
|
||||
<span class="hljs-keyword">return</span> (
|
||||
<span class="xml"><span class="hljs-tag"><<span class="hljs-name">div</span>></span>
|
||||
{
|
||||
pageWithoutIndication.map(p => (
|
||||
<span class="hljs-tag"><<span class="hljs-name">button</span> <span class="hljs-attr">className</span>=<span class="hljs-string">"btn btn-success"</span> <span class="hljs-attr">onClick</span>=<span class="hljs-string">{</span> () =></span> onPageChange(p.page) }>{ p.page }<span class="hljs-tag"></<span class="hljs-name">button</span>></span>
|
||||
))
|
||||
}
|
||||
<span class="hljs-tag"></<span class="hljs-name">div</span>></span></span>
|
||||
);
|
||||
};
|
||||
|
||||
<span class="hljs-keyword">const</span> options = {
|
||||
pageListRenderer
|
||||
};
|
||||
|
||||
<span class="xml"><span class="hljs-tag"><<span class="hljs-name">BootstrapTable</span> <span class="hljs-attr">keyField</span>=<span class="hljs-string">"id"</span> <span class="hljs-attr">data</span>=<span class="hljs-string">{</span> <span class="hljs-attr">products</span> } <span class="hljs-attr">columns</span>=<span class="hljs-string">{</span> <span class="hljs-attr">columns</span> } <span class="hljs-attr">pagination</span>=<span class="hljs-string">{</span> <span class="hljs-attr">paginationFactory</span>(<span class="hljs-attr">options</span>) } /></span>
|
||||
</span></code></pre>
|
||||
<h2><a class="anchor" aria-hidden="true" name="paginationsizeperpagerenderer-function"></a><a href="#paginationsizeperpagerenderer-function" 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>pagination.sizePerPageRenderer - [Function]</h2>
|
||||
<p>Custom the size per page dropdown component, this callback function have one argument which is an object and contain following props:</p>
|
||||
<ul>
|
||||
<li><code>options</code>: Dropdown option.</li>
|
||||
<li><code>currSizePerPage</code>: Current size per page.</li>
|
||||
<li><code>onSizePerPageChange</code>: Call it when you need to change size per page.</li>
|
||||
</ul>
|
||||
<p>Below is a minimal example:</p>
|
||||
<pre><code class="hljs css js"><span class="hljs-keyword">const</span> sizePerPageRenderer = ({
|
||||
options,
|
||||
currSizePerPage,
|
||||
onSizePerPageChange
|
||||
}) => (
|
||||
<span class="xml"><span class="hljs-tag"><<span class="hljs-name">div</span> <span class="hljs-attr">className</span>=<span class="hljs-string">"btn-group"</span> <span class="hljs-attr">role</span>=<span class="hljs-string">"group"</span>></span>
|
||||
{
|
||||
options.map(option => (
|
||||
<span class="hljs-tag"><<span class="hljs-name">button</span>
|
||||
<span class="hljs-attr">key</span>=<span class="hljs-string">{</span> <span class="hljs-attr">option.text</span> }
|
||||
<span class="hljs-attr">type</span>=<span class="hljs-string">"button"</span>
|
||||
<span class="hljs-attr">onClick</span>=<span class="hljs-string">{</span> () =></span> onSizePerPageChange(option.page) }
|
||||
className={ `btn ${currSizePerPage === `${option.page}` ? 'btn-secondary' : 'btn-warning'}` }
|
||||
>
|
||||
{ option.text }
|
||||
<span class="hljs-tag"></<span class="hljs-name">button</span>></span>
|
||||
))
|
||||
}
|
||||
<span class="hljs-tag"></<span class="hljs-name">div</span>></span></span>
|
||||
);
|
||||
|
||||
<span class="hljs-keyword">const</span> options = {
|
||||
sizePerPageRenderer
|
||||
};
|
||||
|
||||
<span class="xml"><span class="hljs-tag"><<span class="hljs-name">BootstrapTable</span> <span class="hljs-attr">keyField</span>=<span class="hljs-string">"id"</span> <span class="hljs-attr">data</span>=<span class="hljs-string">{</span> <span class="hljs-attr">products</span> } <span class="hljs-attr">columns</span>=<span class="hljs-string">{</span> <span class="hljs-attr">columns</span> } <span class="hljs-attr">pagination</span>=<span class="hljs-string">{</span> <span class="hljs-attr">paginationFactory</span>(<span class="hljs-attr">options</span>) } /></span>
|
||||
</span></code></pre>
|
||||
<h2><a class="anchor" aria-hidden="true" name="paginationsizeperpageoptionrenderer-function"></a><a href="#paginationsizeperpageoptionrenderer-function" 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>pagination.sizePerPageOptionRenderer - [Function]</h2>
|
||||
<p>Custom the option of size per page dropdown component, this callback function have one argument which is an object and contain following props:</p>
|
||||
<ul>
|
||||
<li><code>text</code>: The text of option.</li>
|
||||
<li><code>page</code>: The size per page of option.</li>
|
||||
<li><code>onSizePerPageChange</code>: Call it when you need to change size per page.</li>
|
||||
</ul>
|
||||
<p>Below is a minimal example:</p>
|
||||
<pre><code class="hljs css js"><span class="hljs-keyword">const</span> sizePerPageOptionRenderer = ({
|
||||
text,
|
||||
page,
|
||||
onSizePerPageChange
|
||||
}) => (
|
||||
<span class="xml"><span class="hljs-tag"><<span class="hljs-name">li</span>
|
||||
<span class="hljs-attr">key</span>=<span class="hljs-string">{</span> <span class="hljs-attr">text</span> }
|
||||
<span class="hljs-attr">role</span>=<span class="hljs-string">"presentation"</span>
|
||||
<span class="hljs-attr">className</span>=<span class="hljs-string">"dropdown-item"</span>
|
||||
></span>
|
||||
<span class="hljs-tag"><<span class="hljs-name">a</span>
|
||||
<span class="hljs-attr">href</span>=<span class="hljs-string">"#"</span>
|
||||
<span class="hljs-attr">tabIndex</span>=<span class="hljs-string">"-1"</span>
|
||||
<span class="hljs-attr">role</span>=<span class="hljs-string">"menuitem"</span>
|
||||
<span class="hljs-attr">data-page</span>=<span class="hljs-string">{</span> <span class="hljs-attr">page</span> }
|
||||
<span class="hljs-attr">onMouseDown</span>=<span class="hljs-string">{</span> (<span class="hljs-attr">e</span>) =></span> {
|
||||
e.preventDefault();
|
||||
onSizePerPageChange(page);
|
||||
} }
|
||||
style={ { color: 'red' } }
|
||||
>
|
||||
{ text }
|
||||
<span class="hljs-tag"></<span class="hljs-name">a</span>></span>
|
||||
<span class="hljs-tag"></<span class="hljs-name">li</span>></span></span>
|
||||
);
|
||||
|
||||
<span class="hljs-keyword">const</span> options = {
|
||||
sizePerPageOptionRenderer
|
||||
};
|
||||
|
||||
<span class="xml"><span class="hljs-tag"><<span class="hljs-name">BootstrapTable</span> <span class="hljs-attr">keyField</span>=<span class="hljs-string">"id"</span> <span class="hljs-attr">data</span>=<span class="hljs-string">{</span> <span class="hljs-attr">products</span> } <span class="hljs-attr">columns</span>=<span class="hljs-string">{</span> <span class="hljs-attr">columns</span> } <span class="hljs-attr">pagination</span>=<span class="hljs-string">{</span> <span class="hljs-attr">paginationFactory</span>(<span class="hljs-attr">options</span>) } /></span>
|
||||
</span></code></pre>
|
||||
<h2><a class="anchor" aria-hidden="true" name="paginationpaginationtotalrenderer-function"></a><a href="#paginationpaginationtotalrenderer-function" 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>pagination.paginationTotalRenderer - [Function]</h2>
|
||||
<p>Custom the total information, this callbacok function have three arguments: <code>from</code>, <code>to</code> and <code>size</code>. Following is an example:</p>
|
||||
<pre><code class="hljs css js"><span class="hljs-keyword">const</span> customTotal = <span class="hljs-function">(<span class="hljs-params"><span class="hljs-keyword">from</span>, to, size</span>) =></span> (
|
||||
|
||||
Reference in New Issue
Block a user