Update fnAddTr.js - Fix - Showing invisible columns

Showing not visible columns and returning the result of fnAddData, also fixes the problem described at https://github.com/DataTables/Plugins/pull/24
pull/26/head
globalinnovation 11 years ago
parent 2adba8a7db
commit 404f049976

@ -23,9 +23,19 @@ $.fn.dataTableExt.oApi.fnAddTr = function ( oSettings, nTr, bRedraw ) {
} }
var aData = []; var aData = [];
var aInvisible = [];
for ( var i=0 ; i<nTds.length ; i++ ) for ( var i=0 ; i<nTds.length ; i++ )
{ {
aData.push( nTds[i].innerHTML ); aData.push( nTds[i].innerHTML );
if (!oSettings.aoColumns[i].bVisible)
{
aInvisible.push( i );
}
}
for ( var i = (aInvisible.length - 1) ; i >= 0 ; i-- )
{
nTds[aInvisible[i]].remove();
} }
/* Add the data and then replace DataTable's generated TR with ours */ /* Add the data and then replace DataTable's generated TR with ours */

Loading…
Cancel
Save