You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Plugins/api/fnPagingInfo.js

31 lines
1.0 KiB
JavaScript

/**
* Get information about the paging settings that DataTables is currently
* using to display each page, including the number of records shown, start
* and end points in the data set etc.
* @name fnPagingInfo
* @anchor fnPagingInfo
* @author <a href="http://sprymedia.co.uk">Allan Jardine</a>
*
* @example
* $(document).ready(function() {
* $('#example').dataTable( {
* "fnDrawCallback": function () {
* alert( 'Now on page'+ this.fnPagingInfo().iPage );
* }
* } );
* } );
*/
$.fn.dataTableExt.oApi.fnPagingInfo = function ( oSettings )
{
return {
"iStart": oSettings._iDisplayStart,
"iEnd": oSettings.fnDisplayEnd(),
"iLength": oSettings._iDisplayLength,
"iTotal": oSettings.fnRecordsTotal(),
"iFilteredTotal": oSettings.fnRecordsDisplay(),
"iPage": Math.ceil( oSettings._iDisplayStart / oSettings._iDisplayLength ),
"iTotalPages": Math.ceil( oSettings.fnRecordsDisplay() / oSettings._iDisplayLength )
};
};