| 4 |
lars |
1 |
|
|
|
2 |
<h2>Custom pagination types</h2>
|
|
|
3 |
|
|
|
4 |
<p>The style of the pagination options that Datatables presents to the end-user can greatly effect the look and feel of your table, as well as, of course, the interaction behaviour. Through the plug-in options you can define your own paging function to create the interaction that you are looking for.</p>
|
|
|
5 |
|
|
|
6 |
<ul>
|
|
|
7 |
<li><a href="#how_to">How to use DataTables plug-in pagination functions</a></li>
|
|
|
8 |
<li><a href="#functions">Plug-in pagination functions</a></li>
|
|
|
9 |
</ul>
|
|
|
10 |
|
|
|
11 |
|
|
|
12 |
<a name="how_to"></a>
|
|
|
13 |
<h3>How to use DataTables plug-in pagination functions</h3>
|
|
|
14 |
|
|
|
15 |
<p>To use a pagination plug-in, you must include the pagination plug-in code from the plug-ins available below, after you load the DataTables library, but before you initialise the DataTable. When initialising the DataTable, you must also tell it to make use of this plug-in, rather than using the default built-in types, by setting the 'sPaginationType' to the value required by the plug-in. As an example the code below makes use of the <a href="#scrolling">scrolling pagination plug-in</a> saved into a file (<a href="/examples/plug-ins/paging_plugin.html">live example</a>):</p>
|
|
|
16 |
|
|
|
17 |
<pre class="brush: html"><script type="text/javascript" src="jquery.dataTables.js"></script>
|
|
|
18 |
<script type="text/javascript" src="dataTables.scrollingPagination.js"></script>
|
|
|
19 |
<script type="text/javascript">
|
|
|
20 |
$(document).ready(function() {
|
|
|
21 |
$('#example').dataTable( {
|
|
|
22 |
"sPaginationType": "scrolling"
|
|
|
23 |
} );
|
|
|
24 |
} );
|
|
|
25 |
</script>
|
|
|
26 |
</pre>
|
|
|
27 |
|
|
|
28 |
|
|
|
29 |
<a name="functions"></a>
|
|
|
30 |
<h3>Plug-in pagination functions</h3>
|
|
|
31 |
|
|
|
32 |
|
|
|
33 |
include(`build.1.inc')
|