FSN#34665 Kolomkoppen worden vastgehouden, opmaak moet nog

svn path=/Website/trunk/; revision=30987
This commit is contained in:
2016-10-05 15:09:32 +00:00
parent 7312065cfc
commit 448227e4b8
2 changed files with 50 additions and 1 deletions

View File

@@ -0,0 +1,49 @@
function UpdateTableHeaders() {
$("div.divrstable").each(function() {
var originalHeaderRow = $(".tableFloatingHeaderOriginal", this);
var floatingHeaderRow = $(".tableFloatingHeader", this);
var firstFrame = $(this).offset();
var secondFrame = $(window.frameElement).offset();
var scrollTop = $(window.parent).scrollTop();
offset = firstFrame.top + secondFrame.top;
if ((scrollTop > offset) && (scrollTop < offset + $(this).height())) {
floatingHeaderRow.css("visibility", "visible");
floatingHeaderRow.css("top", Math.min(scrollTop - offset, $(this).height() - floatingHeaderRow.height()) + "px");
// Copy cell widths from original header
$("th", floatingHeaderRow).each(function(index) {
var cellWidth = $("th", originalHeaderRow).eq(index).css('width');
$(this).css('width', cellWidth);
});
// Copy row width from whole table
floatingHeaderRow.css("width", $(this).css("width"));
}
else {
floatingHeaderRow.css("visibility", "hidden");
floatingHeaderRow.css("top", "0px");
}
});
}
$(document).ready(function() {
$("table").each(function() {
$(this).wrap("<div class=\"divrstable\" style=\"position:relative\"></div>");
var originalHeaderRow = $("tr:first", this)
originalHeaderRow.before(originalHeaderRow.clone());
var clonedHeaderRow = $("tr:first", this)
clonedHeaderRow.addClass("tableFloatingHeader");
clonedHeaderRow.css("position", "absolute");
clonedHeaderRow.css("top", "0px");
clonedHeaderRow.css("left", $(this).css("margin-left"));
clonedHeaderRow.css("visibility", "hidden");
originalHeaderRow.addClass("tableFloatingHeaderOriginal");
});
UpdateTableHeaders();
$(window.parent).scroll(UpdateTableHeaders);
$(window.parent).resize(UpdateTableHeaders);
});

View File

@@ -14,7 +14,7 @@
<%
FCLTHeader.Requires({ plugins: ["jQuery"],
js: ["resultset_table_v2.js", "sorttable.js"]
js: ["resultset_table_v2.js", "sorttable.js", "floatThead.js"]
});
var APIname = getQParam("API","");