File: page%28%29.xml

package info (click to toggle)
datatables.js 1.10.13%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 6,232 kB
  • ctags: 1,329
  • sloc: xml: 10,249; php: 4,387; sh: 492; makefile: 21
file content (52 lines) | stat: -rw-r--r-- 2,650 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?xml version="1.0" encoding="UTF-8" ?>
<dt-api group="core">
	<name>page()</name>
	<summary>Get / set the current page of the table.</summary>
	<since>1.10</since>

	<type type="function">
		<signature>page()</signature>
		<description>Get the current page of the table. Note that if multiple tables are available in the API's context, the current page index of the first table in the context will be used. Use `dt-api table()` if you are working with multiple tables in a single API context.</description>
		<returns type="integer">Currently displayed page number</returns>
	</type>
	<type type="function">
		<signature>page( set )</signature>
		<description>Set the page to be displayed by the table</description>
		<parameter type="string|integer" name="set">
			This parameter can take two forms:

			* integer - The page index to jump to (0 is the first page!)
			* string - An action to take:
			  * `first` - Jump to first page.
			  * `next` - Jump to the next page
			  * `previous` - Jump to previous page
			  * `last` - Jump to the last page.
		</parameter>
		<returns type="DataTables.Api">DataTables API instance</returns>
	</type>

	<description>
		Paging is a core feature of DataTables, and this method provides external control over the page which the table is displaying. This can be useful if you want to provide custom paging controls for your table, external to the built-in paging control options or the paging plug-in options.
		
		Note that if you attempt to show a page which does not exist using the set format of this method, DataTables will not throw an error, but rather reset the paging to the first page.

		Please be aware that this method sets the page to be shown - it does not actually perform the re-display of the table. In order to have the newly set page shown use the `dt-api draw()` method, which can be called simply as a chained method of the `dt-api page()` method's returned object - for example `table.page( 0 ).draw( false );`.

		Additionally note that you should pass `false` or `-string page` as the first parameter to `dt-api draw()` to have it do a standing redraw. Without this parameter, `dt-api draw()` will do a full draw resulting in the paging being reset back to the first page!
	</description>

	<example title="Custom paging controls for next / previous pages"><![CDATA[
var table = $('#example').DataTable();

$('#next').on( 'click', function () {
	table.page( 'next' ).draw( 'page' );
} );

$('#previous').on( 'click', function () {
	table.page( 'previous' ).draw( 'page' );
} );
]]></example>

	<related type="init">paging</related>
	<related type="api">page.len()</related>
</dt-api>