mirror of
https://github.com/DataTables/DataTables.git
synced 2025-03-15 16:29:16 +01:00
Fix: When scrolling the column matching would remove any nested THEAD and TFOOT elements in the table - 8423
This commit is contained in:
parent
6021360da1
commit
ca009fdf88
18
media/js/jquery.dataTables.js
vendored
18
media/js/jquery.dataTables.js
vendored
@ -3049,6 +3049,7 @@
|
|||||||
nScrollHeadTable = nScrollHeadInner.getElementsByTagName('table')[0],
|
nScrollHeadTable = nScrollHeadInner.getElementsByTagName('table')[0],
|
||||||
nScrollBody = o.nTable.parentNode,
|
nScrollBody = o.nTable.parentNode,
|
||||||
i, iLen, j, jLen, anHeadToSize, anHeadSizers, anFootSizers, anFootToSize, oStyle, iVis,
|
i, iLen, j, jLen, anHeadToSize, anHeadSizers, anFootSizers, anFootToSize, oStyle, iVis,
|
||||||
|
nTheadSize, nTfootSize,
|
||||||
iWidth, aApplied=[], iSanityWidth,
|
iWidth, aApplied=[], iSanityWidth,
|
||||||
nScrollFootInner = (o.nTFoot !== null) ? o.nScrollFoot.getElementsByTagName('div')[0] : null,
|
nScrollFootInner = (o.nTFoot !== null) ? o.nScrollFoot.getElementsByTagName('div')[0] : null,
|
||||||
nScrollFootTable = (o.nTFoot !== null) ? nScrollFootInner.getElementsByTagName('table')[0] : null,
|
nScrollFootTable = (o.nTFoot !== null) ? nScrollFootInner.getElementsByTagName('table')[0] : null,
|
||||||
@ -3059,22 +3060,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/* Remove the old minimised thead and tfoot elements in the inner table */
|
/* Remove the old minimised thead and tfoot elements in the inner table */
|
||||||
var nTheadSize = o.nTable.getElementsByTagName('thead');
|
$(o.nTable).children('thead, tfoot').remove();
|
||||||
if ( nTheadSize.length > 0 )
|
|
||||||
{
|
|
||||||
o.nTable.removeChild( nTheadSize[0] );
|
|
||||||
}
|
|
||||||
|
|
||||||
var nTfootSize;
|
|
||||||
if ( o.nTFoot !== null )
|
|
||||||
{
|
|
||||||
/* Remove the old minimised footer element in the cloned header */
|
|
||||||
nTfootSize = o.nTable.getElementsByTagName('tfoot');
|
|
||||||
if ( nTfootSize.length > 0 )
|
|
||||||
{
|
|
||||||
o.nTable.removeChild( nTfootSize[0] );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Clone the current header and footer elements and then place it into the inner table */
|
/* Clone the current header and footer elements and then place it into the inner table */
|
||||||
nTheadSize = o.nTHead.cloneNode(true);
|
nTheadSize = o.nTHead.cloneNode(true);
|
||||||
|
@ -180,6 +180,7 @@ function _fnScrollDraw ( o )
|
|||||||
nScrollHeadTable = nScrollHeadInner.getElementsByTagName('table')[0],
|
nScrollHeadTable = nScrollHeadInner.getElementsByTagName('table')[0],
|
||||||
nScrollBody = o.nTable.parentNode,
|
nScrollBody = o.nTable.parentNode,
|
||||||
i, iLen, j, jLen, anHeadToSize, anHeadSizers, anFootSizers, anFootToSize, oStyle, iVis,
|
i, iLen, j, jLen, anHeadToSize, anHeadSizers, anFootSizers, anFootToSize, oStyle, iVis,
|
||||||
|
nTheadSize, nTfootSize,
|
||||||
iWidth, aApplied=[], iSanityWidth,
|
iWidth, aApplied=[], iSanityWidth,
|
||||||
nScrollFootInner = (o.nTFoot !== null) ? o.nScrollFoot.getElementsByTagName('div')[0] : null,
|
nScrollFootInner = (o.nTFoot !== null) ? o.nScrollFoot.getElementsByTagName('div')[0] : null,
|
||||||
nScrollFootTable = (o.nTFoot !== null) ? nScrollFootInner.getElementsByTagName('table')[0] : null,
|
nScrollFootTable = (o.nTFoot !== null) ? nScrollFootInner.getElementsByTagName('table')[0] : null,
|
||||||
@ -190,22 +191,7 @@ function _fnScrollDraw ( o )
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/* Remove the old minimised thead and tfoot elements in the inner table */
|
/* Remove the old minimised thead and tfoot elements in the inner table */
|
||||||
var nTheadSize = o.nTable.getElementsByTagName('thead');
|
$(o.nTable).children('thead, tfoot').remove();
|
||||||
if ( nTheadSize.length > 0 )
|
|
||||||
{
|
|
||||||
o.nTable.removeChild( nTheadSize[0] );
|
|
||||||
}
|
|
||||||
|
|
||||||
var nTfootSize;
|
|
||||||
if ( o.nTFoot !== null )
|
|
||||||
{
|
|
||||||
/* Remove the old minimised footer element in the cloned header */
|
|
||||||
nTfootSize = o.nTable.getElementsByTagName('tfoot');
|
|
||||||
if ( nTfootSize.length > 0 )
|
|
||||||
{
|
|
||||||
o.nTable.removeChild( nTfootSize[0] );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Clone the current header and footer elements and then place it into the inner table */
|
/* Clone the current header and footer elements and then place it into the inner table */
|
||||||
nTheadSize = o.nTHead.cloneNode(true);
|
nTheadSize = o.nTHead.cloneNode(true);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user