mirror of
https://github.com/dawidolko/Website-Templates.git
synced 2026-03-23 02:52:18 +00:00
Website templates
This commit is contained in:
48
startbootstrap-sb-admin-2-1.0.5/bower_components/datatables-plugins/api/fnlengthchange.js
vendored
Normal file
48
startbootstrap-sb-admin-2-1.0.5/bower_components/datatables-plugins/api/fnlengthchange.js
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
/**
|
||||
* Change the number of records that can be viewed on a single page in
|
||||
* DataTables.
|
||||
*
|
||||
* DataTables 1.10 provides the `dt-api page.len()` method to get and set the
|
||||
* page length using the built-in API. As such this method is marked deprecated,
|
||||
* but is available for use with legacy version of DataTables. Please use the
|
||||
* new API if you are used DataTables 1.10 or newer.
|
||||
*
|
||||
* @name fnLengthChange
|
||||
* @summary Change the paging display length
|
||||
* @author [Pedro Alves](http://www.webdetails.pt/)
|
||||
* @deprecated
|
||||
*
|
||||
* @example
|
||||
* $(document).ready(function() {
|
||||
* var table = $('#example').dataTable();
|
||||
* table.fnLengthChange( 100 );
|
||||
* } );
|
||||
*/
|
||||
|
||||
jQuery.fn.dataTableExt.oApi.fnLengthChange = function ( oSettings, iDisplay )
|
||||
{
|
||||
oSettings._iDisplayLength = iDisplay;
|
||||
oSettings.oApi._fnCalculateEnd( oSettings );
|
||||
|
||||
/* If we have space to show extra rows (backing up from the end point - then do so */
|
||||
if ( oSettings._iDisplayEnd == oSettings.aiDisplay.length )
|
||||
{
|
||||
oSettings._iDisplayStart = oSettings._iDisplayEnd - oSettings._iDisplayLength;
|
||||
if ( oSettings._iDisplayStart < 0 )
|
||||
{
|
||||
oSettings._iDisplayStart = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if ( oSettings._iDisplayLength == -1 )
|
||||
{
|
||||
oSettings._iDisplayStart = 0;
|
||||
}
|
||||
|
||||
oSettings.oApi._fnDraw( oSettings );
|
||||
|
||||
if ( oSettings.aanFeatures.l )
|
||||
{
|
||||
$('select', oSettings.aanFeatures.l).val( iDisplay );
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user