From 8ac7bc7c413e3602536ead84c5b4a7627dbf8f03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Camblor?= Date: Sun, 26 Feb 2012 02:58:40 +0100 Subject: [PATCH] Fixing bug when footer is true and cloneHeadToFoot is not : scrolling was not working on footer nor footer fixedColumn --- jquery.fixedheadertable.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/jquery.fixedheadertable.js b/jquery.fixedheadertable.js index aed7e15..ea8d068 100644 --- a/jquery.fixedheadertable.js +++ b/jquery.fixedheadertable.js @@ -352,7 +352,7 @@ 'margin-left': -this.scrollLeft }); - if ( settings.cloneHeadToFoot ) { + if (settings.footer || settings.cloneHeadToFoot ) { $tfoot.find('table') .css({ 'margin-left': -this.scrollLeft @@ -402,7 +402,7 @@ $fixedColumn = $wrapper.find('.fht-fixed-column'), $thead = $('
'), $tbody = $('
'), - $tfoot = $('
'), + $tfoot = $('
'), $firstThChild = $fixedBody.find('.fht-thead thead tr th:first-child'), $firstTdChildren, fixedColumnWidth = $firstThChild.outerWidth(true) + tableProps.border, @@ -452,8 +452,13 @@ // setup clone footer with fixed column if ( settings.footer == true || settings.cloneHeadToFoot == true ) { - var $firstTdFootChild = $fixedBody.find('.fht-tfoot thead tr th:first-child'); - + var $firstTdFootChild; + if(settings.cloneHeadToFoot){ + $firstTdFootChild = $fixedBody.find('.fht-thead thead tr th:first-child'); + } else { + $firstTdFootChild = $fixedBody.find('.fht-tfoot tfoot tr td:first-child'); + } + helpers._fixHeightWithCss( $firstTdFootChild, tableProps ); $tfoot.appendTo($fixedColumn) .find('tr')