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
|
<?xml version="1.0" encoding="UTF-8" ?>
<dt-event>
<name>page</name>
<summary>Page change event - fired when the table's paging is updated.</summary>
<since>1.10</since>
<type type="function">
<signature>function( e, settings )</signature>
<parameter type="object" name="e">
jQuery event object
</parameter>
<parameter type="DataTables.Settings" name="settings">
DataTables settings object
</parameter>
<scope>HTML table element</scope>
</type>
<description>
The `dt-event page` event is fired the table's paging state changes. This can be the end user selecting the page to view or the page length from the built-in controls, or when the page state is altered by the API (`dt-api page()`).
Note that the `dt-event page` will be fired before the table has been redrawn with the updated data.
Please note that, as with all DataTables emitted events, this event is triggered with the `dt` namespace. As such, to listen for this event, you must also use the `dt` namespace by simply appending `.dt` to your event name, as shown in the example below.
</description>
<example title="Show information about the current page using the API"><![CDATA[
var table = $('#example').DataTable();
$('#example').on( 'page.dt', function () {
var info = table.page.info();
$('#pageInfo').html( 'Showing page: '+info.page+' of '+info.pages );
} );
]]></example>
<related type="option">paging</related>
<related type="option">pagingType</related>
<related type="api">page()</related>
<related type="api">page.info()</related>
<related type="api">page.len()</related>
<related type="event">length</related>
</dt-event>
|