diff --git a/media/js/jquery.dataTables.js b/media/js/jquery.dataTables.js index f78d1ece..d2acdc92 100644 --- a/media/js/jquery.dataTables.js +++ b/media/js/jquery.dataTables.js @@ -1184,7 +1184,7 @@ */ function _fnDrawHead( oSettings, aoSource, bIncludeHidden ) { - var i, iLen, j, jLen, k, kLen; + var i, iLen, j, jLen, k, kLen, n, nLocalTr; var aoLocal = []; var aApplied = []; var iColumns = oSettings.aoColumns.length; @@ -1216,12 +1216,14 @@ for ( i=0, iLen=aoLocal.length ; i=0 ; i-- ) + while( (n = oSettings.nTBody.firstChild) ) { - nTrs[i].parentNode.removeChild( nTrs[i] ); + oSettings.nTBody.removeChild( n ); } } diff --git a/media/src/core/core.draw.js b/media/src/core/core.draw.js index df7d5600..22ff1504 100644 --- a/media/src/core/core.draw.js +++ b/media/src/core/core.draw.js @@ -215,7 +215,7 @@ function _fnBuildHead( oSettings ) */ function _fnDrawHead( oSettings, aoSource, bIncludeHidden ) { - var i, iLen, j, jLen, k, kLen; + var i, iLen, j, jLen, k, kLen, n, nLocalTr; var aoLocal = []; var aApplied = []; var iColumns = oSettings.aoColumns.length; @@ -247,12 +247,14 @@ function _fnDrawHead( oSettings, aoSource, bIncludeHidden ) for ( i=0, iLen=aoLocal.length ; i=0 ; i-- ) + while( (n = oSettings.nTBody.firstChild) ) { - nTrs[i].parentNode.removeChild( nTrs[i] ); + oSettings.nTBody.removeChild( n ); } }