diff --git a/APPL/Localscripts/FcltJquery.js b/APPL/Localscripts/FcltJquery.js index e3f4bf0e21..30435b2f84 100644 --- a/APPL/Localscripts/FcltJquery.js +++ b/APPL/Localscripts/FcltJquery.js @@ -424,7 +424,7 @@ function updateTableHeaders() { floatingHeaderRow.css("width", $(this).css("width")-1); var insideFrame = $(this).offset(); var outsideFrame = $(window.frameElement).offset(); - var scrollTop = $(window.parent).scrollTop(); + var scrollTop = $(window.parent).scrollTop() + $(window).scrollTop(); var offset = 0; if (insideFrame) offset += insideFrame.top; if (outsideFrame) offset += outsideFrame.top; @@ -445,7 +445,7 @@ function updateTableHeaders() { }); } -$(document).ready(function() { +function loadTableHeaders() { $("table").each(function() { $(this).wrap("
"); @@ -462,8 +462,15 @@ $(document).ready(function() { clonedHeaderRow.css("opacity", "0.90"); originalHeaderRow.addClass("tableFloatingHeaderOriginal"); + }); updateTableHeaders(); $(window.parent).scroll(updateTableHeaders); $(window.parent).resize(updateTableHeaders); +}; + + +$(function() { + // This should be executed lastly to ensure correct display of the table header. + setTimeout( loadTableHeaders, 250); }); \ No newline at end of file diff --git a/APPL/Localscripts/sorttable.js b/APPL/Localscripts/sorttable.js index b8d9c75152..7c27de309b 100644 --- a/APPL/Localscripts/sorttable.js +++ b/APPL/Localscripts/sorttable.js @@ -75,7 +75,7 @@ var sorttable = { } // work through each column and calculate its type - var headrow = tableTheadTRs[0].querySelectorAll('td, th'); + var headrow = tableTheadTRs[0].cells; for (var i=0; i