Update fnGetHiddenNodes to be compatible with 1.10

pull/40/head
Allan Jardine 11 years ago
parent fcd3b3cf0d
commit 34eec35704

@ -6,22 +6,29 @@
* @author <a href="http://sprymedia.co.uk">Allan Jardine</a> * @author <a href="http://sprymedia.co.uk">Allan Jardine</a>
*/ */
$.fn.dataTableExt.oApi.fnGetHiddenNodes = function ( oSettings ) $.fn.dataTableExt.oApi.fnGetHiddenNodes = function ( settings )
{ {
/* Note the use of a DataTables 'private' function thought the 'oApi' object */ var nodes;
var anNodes = this.oApi._fnGetTrNodes( oSettings ); var display = $('tbody tr', settings.nTable);
var anDisplay = $('tbody tr', oSettings.nTable);
if ( $.fn.dataTable.versionCheck ) {
// DataTables 1.10
var api = new $.fn.dataTable.Api( settings );
nodes = api.rows().nodes().toArray();
}
else {
// 1.9-
nodes = this.oApi._fnGetTrNodes( settings );
}
/* Remove nodes which are being displayed */ /* Remove nodes which are being displayed */
for ( var i=0 ; i<anDisplay.length ; i++ ) for ( var i=0 ; i<display.length ; i++ ) {
{ var iIndex = jQuery.inArray( display[i], nodes );
var iIndex = jQuery.inArray( anDisplay[i], anNodes );
if ( iIndex != -1 ) if ( iIndex != -1 ) {
{ nodes.splice( iIndex, 1 );
anNodes.splice( iIndex, 1 );
} }
} }
/* Fire back the array to the caller */ return nodes;
return anNodes;
}; };

Loading…
Cancel
Save