mirror of
https://github.com/billz/raspap-webgui.git
synced 2025-03-01 10:31:47 +00:00
Added assets + dependencies
This commit is contained in:
46
bower_components/datatables-plugins/api/fnDisplayRow.js
vendored
Executable file
46
bower_components/datatables-plugins/api/fnDisplayRow.js
vendored
Executable file
@@ -0,0 +1,46 @@
|
||||
/**
|
||||
* This plug-in will take a `dt-tag tr` element and alter the table's paging
|
||||
* to make that `dt-tag tr` element (i.e. that row) visible.
|
||||
*
|
||||
* @name fnDisplayRow
|
||||
* @summary Shift the table's paging to display a given `dt-tag tr` element
|
||||
* @author [Allan Jardine](http://sprymedia.co.uk)
|
||||
*
|
||||
* @param {node} nRow Row to display
|
||||
*
|
||||
* @example
|
||||
* // Display the 21st row in the table
|
||||
* var table = $('#example').dataTable();
|
||||
* table.fnDisplayRow( table.fnGetNodes()[20] );
|
||||
*/
|
||||
|
||||
jQuery.fn.dataTableExt.oApi.fnDisplayRow = function ( oSettings, nRow )
|
||||
{
|
||||
// Account for the "display" all case - row is already displayed
|
||||
if ( oSettings._iDisplayLength == -1 )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Find the node in the table
|
||||
var iPos = -1;
|
||||
for( var i=0, iLen=oSettings.aiDisplay.length ; i<iLen ; i++ )
|
||||
{
|
||||
if( oSettings.aoData[ oSettings.aiDisplay[i] ].nTr == nRow )
|
||||
{
|
||||
iPos = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Alter the start point of the paging display
|
||||
if( iPos >= 0 )
|
||||
{
|
||||
oSettings._iDisplayStart = ( Math.floor(i / oSettings._iDisplayLength) ) * oSettings._iDisplayLength;
|
||||
if ( this.oApi._fnCalculateEnd ) {
|
||||
this.oApi._fnCalculateEnd( oSettings );
|
||||
}
|
||||
}
|
||||
|
||||
this.oApi._fnDraw( oSettings );
|
||||
};
|
||||
Reference in New Issue
Block a user