From daf24e72fd98d631a3df8c772381737b8707266e Mon Sep 17 00:00:00 2001 From: Giordano Battilana Date: Thu, 20 Oct 2016 11:09:19 +0200 Subject: [PATCH 1/5] support the option of cloning events when cloning header/footer/columns --- jquery.fixedheadertable.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/jquery.fixedheadertable.js b/jquery.fixedheadertable.js index 1d052d8..195a94c 100644 --- a/jquery.fixedheadertable.js +++ b/jquery.fixedheadertable.js @@ -34,6 +34,7 @@ autoShow: true, // hide table after its created footer: false, // show footer cloneHeadToFoot: false, // clone head and use as footer + cloneEvents: false, // clone events (useful if header or first row contain active elements) autoResize: false, // resize table if its parent wrapper changes size create: null // callback after plugin completes }; @@ -135,7 +136,7 @@ .addClass(settings.originalTable.attr('class')) .attr('style', settings.originalTable.attr('style')); - $thead.clone().appendTo($divHead.find('table')); + $thead.clone(settings.cloneEvents).appendTo($divHead.find('table')); } else { $divHead = $wrapper.find('div.fht-thead'); } @@ -436,7 +437,7 @@ // clone header $thead.appendTo($fixedColumn) .find('tr') - .append($firstThChildren.clone()); + .append($firstThChildren.clone(settings.cloneEvents)); $tbody.appendTo($fixedColumn) .css({ @@ -453,7 +454,7 @@ } } - $(this).clone() + $(this).clone(settings.cloneEvents) .appendTo($newRow); }); @@ -496,7 +497,7 @@ helpers._fixHeightWithCss($firstTdFootChild, tableProps); $tfoot.appendTo($fixedColumn) .find('tr') - .append($firstTdFootChild.clone()); + .append($firstTdFootChild.clone(settings.cloneEvents)); // Set (view width) of $tfoot div to width of table (this accounts for footers with a colspan) footwidth = $tfoot.find('table').innerWidth(); $tfoot.css({ @@ -531,7 +532,7 @@ $divFoot.empty(); $divHead.find('table') - .clone() + .clone(settings.cloneEvents) .appendTo($divFoot); break; From 14ce4bce6d390033542dfe105feb650511629828 Mon Sep 17 00:00:00 2001 From: Giordano Battilana Date: Thu, 20 Oct 2016 11:14:23 +0200 Subject: [PATCH 2/5] updated minified version --- jquery.fixedheadertable.min.js | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/jquery.fixedheadertable.min.js b/jquery.fixedheadertable.min.js index 6c8a9ef..f8ed503 100644 --- a/jquery.fixedheadertable.min.js +++ b/jquery.fixedheadertable.min.js @@ -1,20 +1 @@ -/*! - * jquery.fixedHeaderTable. The jQuery fixedHeaderTable plugin - * - * Copyright (c) 2013 Mark Malek - * http://fixedheadertable.com - * - * Licensed under MIT - * http://www.opensource.org/licenses/mit-license.php - * - * http://docs.jquery.com/Plugins/Authoring - * jQuery authoring guidelines - * - * Launch : October 2009 - * Version : 1.3 - * Released: May 9th, 2011 - * - * - * all CSS sizing (width,height) is done in pixels (px) - */(function(c){c.fn.fixedHeaderTable=function(m){var u={width:"100%",height:"100%",themeClass:"fht-default",borderCollapse:!0,fixedColumns:0,fixedColumn:!1,sortable:!1,autoShow:!0,footer:!1,cloneHeadToFoot:!1,autoResize:!1,create:null},b={},n={init:function(a){b=c.extend({},u,a);return this.each(function(){var a=c(this);h._isTable(a)?(n.setup.apply(this,Array.prototype.slice.call(arguments,1)),c.isFunction(b.create)&&b.create.call(this)):c.error("Invalid table mark-up")})},setup:function(){var a=c(this), d=a.find("thead"),e=a.find("tfoot"),g=0,f,k,p;b.originalTable=c(this).clone();b.includePadding=h._isPaddingIncludedWithWidth();b.scrollbarOffset=h._getScrollbarWidth();b.themeClassName=b.themeClass;f=-1'));f=a.closest(".fht-table-wrapper");!0==b.fixedColumn&&0>=b.fixedColumns&&(b.fixedColumns= 1);0'),c('
').prependTo(f),k=f.find(".fht-fixed-body"));f.css({width:b.width,height:b.height}).addClass(b.themeClassName);a.hasClass("fht-table-init")||a.wrap('
');p=a.closest(".fht-tbody");var l=h._getTableProps(a);h._setupClone(p,l.tbody);a.hasClass("fht-table-init")?k=f.find("div.fht-thead"):(k=0
').prependTo(k): c('
').prependTo(f),k.find("table.fht-table").addClass(b.originalTable.attr("class")).attr("style",b.originalTable.attr("style")),d.clone().appendTo(k.find("table")));h._setupClone(k,l.thead);a.css({"margin-top":-k.outerHeight(!0)});!0==b.footer&&(h._setupTableFooter(a,this,l),e.length||(e=f.find("div.fht-tfoot table")),g=e.outerHeight(!0));d=f.height()-d.outerHeight(!0)-g-l.border;p.css({height:d});a.addClass("fht-table-init");"undefined"!== typeof b.altClass&&n.altRows.apply(this);0
'),p=c('
');a=c('
'); var g=g.width(),l=f.find(".fht-tbody").height()-b.scrollbarOffset,q,t,r,s;k.find("table.fht-table").addClass(b.originalTable.attr("class"));p.find("table.fht-table").addClass(b.originalTable.attr("class"));a.find("table.fht-table").addClass(b.originalTable.attr("class"));q=f.find(".fht-thead thead tr > *:lt("+b.fixedColumns+")");r=b.fixedColumns*e.border;q.each(function(){r+=c(this).outerWidth(!0)});h._fixHeightWithCss(q,e);h._fixWidthWithCss(q,e);var m=[];q.each(function(){m.push(c(this).width())}); t=f.find("tbody tr > *:not(:nth-child(n+"+(b.fixedColumns+1)+"))").each(function(a){h._fixHeightWithCss(c(this),e);h._fixWidthWithCss(c(this),e,m[a%b.fixedColumns])});k.appendTo(d).find("tr").append(q.clone());p.appendTo(d).css({"margin-top":-1,height:l+e.border});t.each(function(a){0==a%b.fixedColumns&&(s=c("").appendTo(p.find("tbody")),b.altClass&&c(this).parent().hasClass(b.altClass)&&s.addClass(b.altClass));c(this).clone().appendTo(s)});d.css({height:0,width:r});var n=d.find(".fht-tbody .fht-table").height()- d.find(".fht-tbody").height();d.find(".fht-tbody .fht-table").bind("mousewheel",function(a,d,b,e){if(0!=e)return a=parseInt(c(this).css("marginTop"),10)+(0 *:lt("+b.fixedColumns+")"),h._fixHeightWithCss(k,e),a.appendTo(d).find("tr").append(k.clone()),d=a.find("table").innerWidth(),a.css({top:b.scrollbarOffset, width:d})},_setupTableFooter:function(a,d,e){d=a.closest(".fht-table-wrapper");var g=a.find("tfoot");a=d.find("div.fht-tfoot");a.length||(a=0
').appendTo(d.find(".fht-fixed-body")):c('
').appendTo(d));a.find("table.fht-table").addClass(b.originalTable.attr("class"));switch(!0){case !g.length&&!0==b.cloneHeadToFoot&&!0==b.footer:e=d.find("div.fht-thead");a.empty(); e.find("table").clone().appendTo(a);break;case g.length&&!1==b.cloneHeadToFoot&&!0==b.footer:a.find("table").append(g).css({"margin-top":-e.border}),h._setupClone(a,e.tfoot)}},_getTableProps:function(a){var d={thead:{},tbody:{},tfoot:{},border:0},c=1;!0==b.borderCollapse&&(c=2);d.border=(a.find("th:first-child").outerWidth()-a.find("th:first-child").innerWidth())/c;d.thead=h._getColumnsWidth(a.find("thead tr"));d.tfoot=h._getColumnsWidth(a.find("tfoot tr"));d.tbody=h._getColumnsWidth(a.find("tbody tr")); return d},_getColumnsWidth:function(a){var d={},b={},g=0,f,k;f=h._getColumnsCount(a);for(k=0;k').appendTo(c(this))).css({width:parseInt(d[a].width,10)}),c(this).closest(".fht-tbody").length||!c(this).is(":last-child")||c(this).closest(".fht-fixed-column").length|| (a=Math.max((c(this).innerWidth()-c(this).width())/2,b.scrollbarOffset),c(this).css({"padding-right":parseInt(c(this).css("padding-right"))+a+"px"})))})})},_isPaddingIncludedWithWidth:function(){var a=c('
test
'),d,e;a.addClass(b.originalTable.attr("class"));a.appendTo("body");d=a.find("td").height();a.find("td").css("height",a.find("tr").height());e=a.find("td").height();a.remove();return d!=e?!0:!1},_getScrollbarWidth:function(){var a= 0;if(!a)if(/msie/.test(navigator.userAgent.toLowerCase())){var b=c('').css({position:"absolute",top:-1E3,left:-1E3}).appendTo("body"),e=c('').css({position:"absolute",top:-1E3,left:-1E3}).appendTo("body"),a=b.width()-e.width()+2;b.add(e).remove()}else b=c("
").css({width:100,height:100,overflow:"auto",position:"absolute",top:-1E3,left:-1E3}).prependTo("body").append("
").find("div").css({width:"100%", height:200}),a=100-b.width(),b.parent().remove();return a}};if(n[m])return n[m].apply(this,Array.prototype.slice.call(arguments,1));if("object"!==typeof m&&m)c.error('Method "'+m+'" does not exist in fixedHeaderTable plugin!');else return n.init.apply(this,arguments)}})(jQuery); - +!function($){$.fn.fixedHeaderTable=function(method){var defaults={width:"100%",height:"100%",themeClass:"fht-default",borderCollapse:!0,fixedColumns:0,fixedColumn:!1,sortable:!1,autoShow:!0,footer:!1,cloneHeadToFoot:!1,cloneEvents:!1,autoResize:!1,create:null},settings={},methods={init:function(options){return settings=$.extend({},defaults,options),this.each(function(){var $self=$(this);helpers._isTable($self)?(methods.setup.apply(this,Array.prototype.slice.call(arguments,1)),$.isFunction(settings.create)&&settings.create.call(this)):$.error("Invalid table mark-up")})},setup:function(){var $wrapper,$divHead,$divBody,$fixedBody,widthMinusScrollbar,$self=$(this),self=this,$thead=$self.find("thead"),$tfoot=$self.find("tfoot"),tfootHeight=0;settings.originalTable=$(this).clone(),settings.includePadding=helpers._isPaddingIncludedWithWidth(),settings.scrollbarOffset=helpers._getScrollbarWidth(),settings.themeClassName=settings.themeClass,widthMinusScrollbar=settings.width.search("%")>-1?$self.parent().width()-settings.scrollbarOffset:settings.width-settings.scrollbarOffset,$self.css({width:widthMinusScrollbar}),$self.closest(".fht-table-wrapper").length||($self.addClass("fht-table"),$self.wrap('
')),$wrapper=$self.closest(".fht-table-wrapper"),1==settings.fixedColumn&&settings.fixedColumns<=0&&(settings.fixedColumns=1),settings.fixedColumns>0&&0==$wrapper.find(".fht-fixed-column").length&&($self.wrap('
'),$('
').prependTo($wrapper),$fixedBody=$wrapper.find(".fht-fixed-body")),$wrapper.css({width:settings.width,height:settings.height}).addClass(settings.themeClassName),$self.hasClass("fht-table-init")||$self.wrap('
'),$divBody=$self.closest(".fht-tbody");var tableProps=helpers._getTableProps($self);helpers._setupClone($divBody,tableProps.tbody),$self.hasClass("fht-table-init")?$divHead=$wrapper.find("div.fht-thead"):($divHead=settings.fixedColumns>0?$('
').prependTo($fixedBody):$('
').prependTo($wrapper),$divHead.find("table.fht-table").addClass(settings.originalTable.attr("class")).attr("style",settings.originalTable.attr("style")),$thead.clone(settings.cloneEvents).appendTo($divHead.find("table"))),helpers._setupClone($divHead,tableProps.thead),$self.css({"margin-top":-$divHead.outerHeight(!0)}),1==settings.footer&&(helpers._setupTableFooter($self,self,tableProps),$tfoot.length||($tfoot=$wrapper.find("div.fht-tfoot table")),tfootHeight=$tfoot.outerHeight(!0));var tbodyHeight=$wrapper.height()-$thead.outerHeight(!0)-tfootHeight-tableProps.border;return $divBody.css({height:tbodyHeight}),$self.addClass("fht-table-init"),"undefined"!=typeof settings.altClass&&methods.altRows.apply(self),settings.fixedColumns>0&&helpers._setupFixedColumn($self,self,tableProps),settings.autoShow||$wrapper.hide(),helpers._bindScroll($divBody,tableProps),self},resize:function(){var self=this;return self},altRows:function(arg1){var $self=$(this),altClass="undefined"!=typeof arg1?arg1:settings.altClass;$self.closest(".fht-table-wrapper").find("tbody tr:odd:not(:hidden)").addClass(altClass)},show:function(arg1,arg2,arg3){var $self=$(this),self=this,$wrapper=$self.closest(".fht-table-wrapper");return"undefined"!=typeof arg1&&"number"==typeof arg1?($wrapper.show(arg1,function(){$.isFunction(arg2)&&arg2.call(this)}),self):"undefined"!=typeof arg1&&"string"==typeof arg1&&"undefined"!=typeof arg2&&"number"==typeof arg2?($wrapper.show(arg1,arg2,function(){$.isFunction(arg3)&&arg3.call(this)}),self):($self.closest(".fht-table-wrapper").show(),$.isFunction(arg1)&&arg1.call(this),self)},hide:function(arg1,arg2,arg3){var $self=$(this),self=this,$wrapper=$self.closest(".fht-table-wrapper");return"undefined"!=typeof arg1&&"number"==typeof arg1?($wrapper.hide(arg1,function(){$.isFunction(arg3)&&arg3.call(this)}),self):"undefined"!=typeof arg1&&"string"==typeof arg1&&"undefined"!=typeof arg2&&"number"==typeof arg2?($wrapper.hide(arg1,arg2,function(){$.isFunction(arg3)&&arg3.call(this)}),self):($self.closest(".fht-table-wrapper").hide(),$.isFunction(arg3)&&arg3.call(this),self)},destroy:function(){var $self=$(this),self=this,$wrapper=$self.closest(".fht-table-wrapper");return $self.insertBefore($wrapper).removeAttr("style").append($wrapper.find("tfoot")).removeClass("fht-table fht-table-init").find(".fht-cell").remove(),$wrapper.remove(),self}},helpers={_isTable:function($obj){var $self=$obj,hasTable=$self.is("table"),hasThead=$self.find("thead").length>0,hasTbody=$self.find("tbody").length>0;return!!(hasTable&&hasThead&&hasTbody)},_bindScroll:function($obj){var $self=$obj,$wrapper=$self.closest(".fht-table-wrapper"),$thead=$self.siblings(".fht-thead"),$tfoot=$self.siblings(".fht-tfoot");$self.bind("scroll",function(){if(settings.fixedColumns>0){var $fixedColumns=$wrapper.find(".fht-fixed-column");$fixedColumns.find(".fht-tbody table").css({"margin-top":-$self.scrollTop()})}$thead.find("table").css({"margin-left":-this.scrollLeft}),(settings.footer||settings.cloneHeadToFoot)&&$tfoot.find("table").css({"margin-left":-this.scrollLeft})})},_fixHeightWithCss:function($obj,tableProps){settings.includePadding?$obj.css({height:$obj.height()+tableProps.border}):$obj.css({height:$obj.parent().height()+tableProps.border})},_fixWidthWithCss:function($obj,tableProps,width){settings.includePadding?$obj.each(function(){$(this).css({width:void 0==width?$(this).width()+tableProps.border:width+tableProps.border})}):$obj.each(function(){$(this).css({width:void 0==width?$(this).parent().width()+tableProps.border:width+tableProps.border})})},_setupFixedColumn:function($obj,obj,tableProps){var $firstThChildren,$firstTdChildren,fixedColumnWidth,$newRow,firstTdChildrenSelector,$self=$obj,$wrapper=$self.closest(".fht-table-wrapper"),$fixedBody=$wrapper.find(".fht-fixed-body"),$fixedColumn=$wrapper.find(".fht-fixed-column"),$thead=$('
'),$tbody=$('
'),$tfoot=$('
'),fixedBodyWidth=$wrapper.width(),fixedBodyHeight=$fixedBody.find(".fht-tbody").height()-settings.scrollbarOffset;$thead.find("table.fht-table").addClass(settings.originalTable.attr("class")),$tbody.find("table.fht-table").addClass(settings.originalTable.attr("class")),$tfoot.find("table.fht-table").addClass(settings.originalTable.attr("class")),$firstThChildren=$fixedBody.find(".fht-thead thead tr > *:lt("+settings.fixedColumns+")"),fixedColumnWidth=settings.fixedColumns*tableProps.border,$firstThChildren.each(function(){fixedColumnWidth+=$(this).outerWidth(!0)}),helpers._fixHeightWithCss($firstThChildren,tableProps),helpers._fixWidthWithCss($firstThChildren,tableProps);var tdWidths=[];$firstThChildren.each(function(){tdWidths.push($(this).width())}),firstTdChildrenSelector="tbody tr > *:not(:nth-child(n+"+(settings.fixedColumns+1)+"))",$firstTdChildren=$fixedBody.find(firstTdChildrenSelector).each(function(index){helpers._fixHeightWithCss($(this),tableProps),helpers._fixWidthWithCss($(this),tableProps,tdWidths[index%settings.fixedColumns])}),$thead.appendTo($fixedColumn).find("tr").append($firstThChildren.clone(settings.cloneEvents)),$tbody.appendTo($fixedColumn).css({"margin-top":-1,height:fixedBodyHeight+tableProps.border}),$firstTdChildren.each(function(index){index%settings.fixedColumns==0&&($newRow=$("").appendTo($tbody.find("tbody")),settings.altClass&&$(this).parent().hasClass(settings.altClass)&&$newRow.addClass(settings.altClass)),$(this).clone(settings.cloneEvents).appendTo($newRow)}),$fixedColumn.css({height:0,width:fixedColumnWidth});var maxTop=$fixedColumn.find(".fht-tbody .fht-table").height()-$fixedColumn.find(".fht-tbody").height();if($fixedColumn.find(".fht-tbody .fht-table").bind("mousewheel",function(event,delta,deltaX,deltaY){if(0!=deltaY){var top=parseInt($(this).css("marginTop"),10)+(deltaY>0?120:-120);return top>0&&(top=0),top<-maxTop&&(top=-maxTop),$(this).css("marginTop",top),$fixedBody.find(".fht-tbody").scrollTop(-top).scroll(),!1}}),$fixedBody.css({width:fixedBodyWidth}),1==settings.footer||1==settings.cloneHeadToFoot){var footwidth,$firstTdFootChild=$fixedBody.find(".fht-tfoot tr > *:lt("+settings.fixedColumns+")");helpers._fixHeightWithCss($firstTdFootChild,tableProps),$tfoot.appendTo($fixedColumn).find("tr").append($firstTdFootChild.clone(settings.cloneEvents)),footwidth=$tfoot.find("table").innerWidth(),$tfoot.css({top:settings.scrollbarOffset,width:footwidth})}},_setupTableFooter:function($obj,obj,tableProps){var $self=$obj,$wrapper=$self.closest(".fht-table-wrapper"),$tfoot=$self.find("tfoot"),$divFoot=$wrapper.find("div.fht-tfoot");switch($divFoot.length||($divFoot=settings.fixedColumns>0?$('
').appendTo($wrapper.find(".fht-fixed-body")):$('
').appendTo($wrapper)),$divFoot.find("table.fht-table").addClass(settings.originalTable.attr("class")),!0){case!$tfoot.length&&1==settings.cloneHeadToFoot&&1==settings.footer:var $divHead=$wrapper.find("div.fht-thead");$divFoot.empty(),$divHead.find("table").clone(settings.cloneEvents).appendTo($divFoot);break;case $tfoot.length&&0==settings.cloneHeadToFoot&&1==settings.footer:$divFoot.find("table").append($tfoot).css({"margin-top":-tableProps.border}),helpers._setupClone($divFoot,tableProps.tfoot)}},_getTableProps:function($obj){var tableProp={thead:{},tbody:{},tfoot:{},border:0},borderCollapse=1;return 1==settings.borderCollapse&&(borderCollapse=2),tableProp.border=($obj.find("th:first-child").outerWidth()-$obj.find("th:first-child").innerWidth())/borderCollapse,$obj.find("thead tr:first-child > *").each(function(index){tableProp.thead[index]=$(this).width()+tableProp.border}),$obj.find("tfoot tr:first-child > *").each(function(index){tableProp.tfoot[index]=$(this).width()+tableProp.border}),$obj.find("tbody tr:first-child > *").each(function(index){tableProp.tbody[index]=$(this).width()+tableProp.border}),tableProp},_setupClone:function($obj,cellArray){var $cell,$self=$obj,selector=$self.find("thead").length?"thead tr:first-child > *":$self.find("tfoot").length?"tfoot tr:first-child > *":"tbody tr:first-child > *";$self.find(selector).each(function(index){if($cell=$(this).find("div.fht-cell").length?$(this).find("div.fht-cell"):$('
').appendTo($(this)),$cell.css({width:parseInt(cellArray[index],10)}),!$(this).closest(".fht-tbody").length&&$(this).is(":last-child")&&!$(this).closest(".fht-fixed-column").length){var padding=Math.max(($(this).innerWidth()-$(this).width())/2,settings.scrollbarOffset);$(this).css({"padding-right":parseInt($(this).css("padding-right"))+padding+"px"})}})},_isPaddingIncludedWithWidth:function(){var defaultHeight,newHeight,$obj=$('
test
');return $obj.addClass(settings.originalTable.attr("class")),$obj.appendTo("body"),defaultHeight=$obj.find("td").height(),$obj.find("td").css("height",$obj.find("tr").height()),newHeight=$obj.find("td").height(),$obj.remove(),defaultHeight!=newHeight},_getScrollbarWidth:function(){var scrollbarWidth=0;if(!scrollbarWidth)if(/msie/.test(navigator.userAgent.toLowerCase())){var $textarea1=$('').css({position:"absolute",top:-1e3,left:-1e3}).appendTo("body"),$textarea2=$('').css({position:"absolute",top:-1e3,left:-1e3}).appendTo("body");scrollbarWidth=$textarea1.width()-$textarea2.width()+2,$textarea1.add($textarea2).remove()}else{var $div=$("
").css({width:100,height:100,overflow:"auto",position:"absolute",top:-1e3,left:-1e3}).prependTo("body").append("
").find("div").css({width:"100%",height:200});scrollbarWidth=100-$div.width(),$div.parent().remove()}return scrollbarWidth}};return methods[method]?methods[method].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof method&&method?void $.error('Method "'+method+'" does not exist in fixedHeaderTable plugin!'):methods.init.apply(this,arguments)}}(jQuery); \ No newline at end of file From e9dc598a58a30ef3307cdd2b602227ed8d2b7242 Mon Sep 17 00:00:00 2001 From: Giordano Battilana Date: Thu, 20 Oct 2016 11:17:36 +0200 Subject: [PATCH 3/5] further minified version (mangled names) --- jquery.fixedheadertable.min.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jquery.fixedheadertable.min.js b/jquery.fixedheadertable.min.js index f8ed503..e633b5a 100644 --- a/jquery.fixedheadertable.min.js +++ b/jquery.fixedheadertable.min.js @@ -1 +1 @@ -!function($){$.fn.fixedHeaderTable=function(method){var defaults={width:"100%",height:"100%",themeClass:"fht-default",borderCollapse:!0,fixedColumns:0,fixedColumn:!1,sortable:!1,autoShow:!0,footer:!1,cloneHeadToFoot:!1,cloneEvents:!1,autoResize:!1,create:null},settings={},methods={init:function(options){return settings=$.extend({},defaults,options),this.each(function(){var $self=$(this);helpers._isTable($self)?(methods.setup.apply(this,Array.prototype.slice.call(arguments,1)),$.isFunction(settings.create)&&settings.create.call(this)):$.error("Invalid table mark-up")})},setup:function(){var $wrapper,$divHead,$divBody,$fixedBody,widthMinusScrollbar,$self=$(this),self=this,$thead=$self.find("thead"),$tfoot=$self.find("tfoot"),tfootHeight=0;settings.originalTable=$(this).clone(),settings.includePadding=helpers._isPaddingIncludedWithWidth(),settings.scrollbarOffset=helpers._getScrollbarWidth(),settings.themeClassName=settings.themeClass,widthMinusScrollbar=settings.width.search("%")>-1?$self.parent().width()-settings.scrollbarOffset:settings.width-settings.scrollbarOffset,$self.css({width:widthMinusScrollbar}),$self.closest(".fht-table-wrapper").length||($self.addClass("fht-table"),$self.wrap('
')),$wrapper=$self.closest(".fht-table-wrapper"),1==settings.fixedColumn&&settings.fixedColumns<=0&&(settings.fixedColumns=1),settings.fixedColumns>0&&0==$wrapper.find(".fht-fixed-column").length&&($self.wrap('
'),$('
').prependTo($wrapper),$fixedBody=$wrapper.find(".fht-fixed-body")),$wrapper.css({width:settings.width,height:settings.height}).addClass(settings.themeClassName),$self.hasClass("fht-table-init")||$self.wrap('
'),$divBody=$self.closest(".fht-tbody");var tableProps=helpers._getTableProps($self);helpers._setupClone($divBody,tableProps.tbody),$self.hasClass("fht-table-init")?$divHead=$wrapper.find("div.fht-thead"):($divHead=settings.fixedColumns>0?$('
').prependTo($fixedBody):$('
').prependTo($wrapper),$divHead.find("table.fht-table").addClass(settings.originalTable.attr("class")).attr("style",settings.originalTable.attr("style")),$thead.clone(settings.cloneEvents).appendTo($divHead.find("table"))),helpers._setupClone($divHead,tableProps.thead),$self.css({"margin-top":-$divHead.outerHeight(!0)}),1==settings.footer&&(helpers._setupTableFooter($self,self,tableProps),$tfoot.length||($tfoot=$wrapper.find("div.fht-tfoot table")),tfootHeight=$tfoot.outerHeight(!0));var tbodyHeight=$wrapper.height()-$thead.outerHeight(!0)-tfootHeight-tableProps.border;return $divBody.css({height:tbodyHeight}),$self.addClass("fht-table-init"),"undefined"!=typeof settings.altClass&&methods.altRows.apply(self),settings.fixedColumns>0&&helpers._setupFixedColumn($self,self,tableProps),settings.autoShow||$wrapper.hide(),helpers._bindScroll($divBody,tableProps),self},resize:function(){var self=this;return self},altRows:function(arg1){var $self=$(this),altClass="undefined"!=typeof arg1?arg1:settings.altClass;$self.closest(".fht-table-wrapper").find("tbody tr:odd:not(:hidden)").addClass(altClass)},show:function(arg1,arg2,arg3){var $self=$(this),self=this,$wrapper=$self.closest(".fht-table-wrapper");return"undefined"!=typeof arg1&&"number"==typeof arg1?($wrapper.show(arg1,function(){$.isFunction(arg2)&&arg2.call(this)}),self):"undefined"!=typeof arg1&&"string"==typeof arg1&&"undefined"!=typeof arg2&&"number"==typeof arg2?($wrapper.show(arg1,arg2,function(){$.isFunction(arg3)&&arg3.call(this)}),self):($self.closest(".fht-table-wrapper").show(),$.isFunction(arg1)&&arg1.call(this),self)},hide:function(arg1,arg2,arg3){var $self=$(this),self=this,$wrapper=$self.closest(".fht-table-wrapper");return"undefined"!=typeof arg1&&"number"==typeof arg1?($wrapper.hide(arg1,function(){$.isFunction(arg3)&&arg3.call(this)}),self):"undefined"!=typeof arg1&&"string"==typeof arg1&&"undefined"!=typeof arg2&&"number"==typeof arg2?($wrapper.hide(arg1,arg2,function(){$.isFunction(arg3)&&arg3.call(this)}),self):($self.closest(".fht-table-wrapper").hide(),$.isFunction(arg3)&&arg3.call(this),self)},destroy:function(){var $self=$(this),self=this,$wrapper=$self.closest(".fht-table-wrapper");return $self.insertBefore($wrapper).removeAttr("style").append($wrapper.find("tfoot")).removeClass("fht-table fht-table-init").find(".fht-cell").remove(),$wrapper.remove(),self}},helpers={_isTable:function($obj){var $self=$obj,hasTable=$self.is("table"),hasThead=$self.find("thead").length>0,hasTbody=$self.find("tbody").length>0;return!!(hasTable&&hasThead&&hasTbody)},_bindScroll:function($obj){var $self=$obj,$wrapper=$self.closest(".fht-table-wrapper"),$thead=$self.siblings(".fht-thead"),$tfoot=$self.siblings(".fht-tfoot");$self.bind("scroll",function(){if(settings.fixedColumns>0){var $fixedColumns=$wrapper.find(".fht-fixed-column");$fixedColumns.find(".fht-tbody table").css({"margin-top":-$self.scrollTop()})}$thead.find("table").css({"margin-left":-this.scrollLeft}),(settings.footer||settings.cloneHeadToFoot)&&$tfoot.find("table").css({"margin-left":-this.scrollLeft})})},_fixHeightWithCss:function($obj,tableProps){settings.includePadding?$obj.css({height:$obj.height()+tableProps.border}):$obj.css({height:$obj.parent().height()+tableProps.border})},_fixWidthWithCss:function($obj,tableProps,width){settings.includePadding?$obj.each(function(){$(this).css({width:void 0==width?$(this).width()+tableProps.border:width+tableProps.border})}):$obj.each(function(){$(this).css({width:void 0==width?$(this).parent().width()+tableProps.border:width+tableProps.border})})},_setupFixedColumn:function($obj,obj,tableProps){var $firstThChildren,$firstTdChildren,fixedColumnWidth,$newRow,firstTdChildrenSelector,$self=$obj,$wrapper=$self.closest(".fht-table-wrapper"),$fixedBody=$wrapper.find(".fht-fixed-body"),$fixedColumn=$wrapper.find(".fht-fixed-column"),$thead=$('
'),$tbody=$('
'),$tfoot=$('
'),fixedBodyWidth=$wrapper.width(),fixedBodyHeight=$fixedBody.find(".fht-tbody").height()-settings.scrollbarOffset;$thead.find("table.fht-table").addClass(settings.originalTable.attr("class")),$tbody.find("table.fht-table").addClass(settings.originalTable.attr("class")),$tfoot.find("table.fht-table").addClass(settings.originalTable.attr("class")),$firstThChildren=$fixedBody.find(".fht-thead thead tr > *:lt("+settings.fixedColumns+")"),fixedColumnWidth=settings.fixedColumns*tableProps.border,$firstThChildren.each(function(){fixedColumnWidth+=$(this).outerWidth(!0)}),helpers._fixHeightWithCss($firstThChildren,tableProps),helpers._fixWidthWithCss($firstThChildren,tableProps);var tdWidths=[];$firstThChildren.each(function(){tdWidths.push($(this).width())}),firstTdChildrenSelector="tbody tr > *:not(:nth-child(n+"+(settings.fixedColumns+1)+"))",$firstTdChildren=$fixedBody.find(firstTdChildrenSelector).each(function(index){helpers._fixHeightWithCss($(this),tableProps),helpers._fixWidthWithCss($(this),tableProps,tdWidths[index%settings.fixedColumns])}),$thead.appendTo($fixedColumn).find("tr").append($firstThChildren.clone(settings.cloneEvents)),$tbody.appendTo($fixedColumn).css({"margin-top":-1,height:fixedBodyHeight+tableProps.border}),$firstTdChildren.each(function(index){index%settings.fixedColumns==0&&($newRow=$("").appendTo($tbody.find("tbody")),settings.altClass&&$(this).parent().hasClass(settings.altClass)&&$newRow.addClass(settings.altClass)),$(this).clone(settings.cloneEvents).appendTo($newRow)}),$fixedColumn.css({height:0,width:fixedColumnWidth});var maxTop=$fixedColumn.find(".fht-tbody .fht-table").height()-$fixedColumn.find(".fht-tbody").height();if($fixedColumn.find(".fht-tbody .fht-table").bind("mousewheel",function(event,delta,deltaX,deltaY){if(0!=deltaY){var top=parseInt($(this).css("marginTop"),10)+(deltaY>0?120:-120);return top>0&&(top=0),top<-maxTop&&(top=-maxTop),$(this).css("marginTop",top),$fixedBody.find(".fht-tbody").scrollTop(-top).scroll(),!1}}),$fixedBody.css({width:fixedBodyWidth}),1==settings.footer||1==settings.cloneHeadToFoot){var footwidth,$firstTdFootChild=$fixedBody.find(".fht-tfoot tr > *:lt("+settings.fixedColumns+")");helpers._fixHeightWithCss($firstTdFootChild,tableProps),$tfoot.appendTo($fixedColumn).find("tr").append($firstTdFootChild.clone(settings.cloneEvents)),footwidth=$tfoot.find("table").innerWidth(),$tfoot.css({top:settings.scrollbarOffset,width:footwidth})}},_setupTableFooter:function($obj,obj,tableProps){var $self=$obj,$wrapper=$self.closest(".fht-table-wrapper"),$tfoot=$self.find("tfoot"),$divFoot=$wrapper.find("div.fht-tfoot");switch($divFoot.length||($divFoot=settings.fixedColumns>0?$('
').appendTo($wrapper.find(".fht-fixed-body")):$('
').appendTo($wrapper)),$divFoot.find("table.fht-table").addClass(settings.originalTable.attr("class")),!0){case!$tfoot.length&&1==settings.cloneHeadToFoot&&1==settings.footer:var $divHead=$wrapper.find("div.fht-thead");$divFoot.empty(),$divHead.find("table").clone(settings.cloneEvents).appendTo($divFoot);break;case $tfoot.length&&0==settings.cloneHeadToFoot&&1==settings.footer:$divFoot.find("table").append($tfoot).css({"margin-top":-tableProps.border}),helpers._setupClone($divFoot,tableProps.tfoot)}},_getTableProps:function($obj){var tableProp={thead:{},tbody:{},tfoot:{},border:0},borderCollapse=1;return 1==settings.borderCollapse&&(borderCollapse=2),tableProp.border=($obj.find("th:first-child").outerWidth()-$obj.find("th:first-child").innerWidth())/borderCollapse,$obj.find("thead tr:first-child > *").each(function(index){tableProp.thead[index]=$(this).width()+tableProp.border}),$obj.find("tfoot tr:first-child > *").each(function(index){tableProp.tfoot[index]=$(this).width()+tableProp.border}),$obj.find("tbody tr:first-child > *").each(function(index){tableProp.tbody[index]=$(this).width()+tableProp.border}),tableProp},_setupClone:function($obj,cellArray){var $cell,$self=$obj,selector=$self.find("thead").length?"thead tr:first-child > *":$self.find("tfoot").length?"tfoot tr:first-child > *":"tbody tr:first-child > *";$self.find(selector).each(function(index){if($cell=$(this).find("div.fht-cell").length?$(this).find("div.fht-cell"):$('
').appendTo($(this)),$cell.css({width:parseInt(cellArray[index],10)}),!$(this).closest(".fht-tbody").length&&$(this).is(":last-child")&&!$(this).closest(".fht-fixed-column").length){var padding=Math.max(($(this).innerWidth()-$(this).width())/2,settings.scrollbarOffset);$(this).css({"padding-right":parseInt($(this).css("padding-right"))+padding+"px"})}})},_isPaddingIncludedWithWidth:function(){var defaultHeight,newHeight,$obj=$('
test
');return $obj.addClass(settings.originalTable.attr("class")),$obj.appendTo("body"),defaultHeight=$obj.find("td").height(),$obj.find("td").css("height",$obj.find("tr").height()),newHeight=$obj.find("td").height(),$obj.remove(),defaultHeight!=newHeight},_getScrollbarWidth:function(){var scrollbarWidth=0;if(!scrollbarWidth)if(/msie/.test(navigator.userAgent.toLowerCase())){var $textarea1=$('').css({position:"absolute",top:-1e3,left:-1e3}).appendTo("body"),$textarea2=$('').css({position:"absolute",top:-1e3,left:-1e3}).appendTo("body");scrollbarWidth=$textarea1.width()-$textarea2.width()+2,$textarea1.add($textarea2).remove()}else{var $div=$("
").css({width:100,height:100,overflow:"auto",position:"absolute",top:-1e3,left:-1e3}).prependTo("body").append("
").find("div").css({width:"100%",height:200});scrollbarWidth=100-$div.width(),$div.parent().remove()}return scrollbarWidth}};return methods[method]?methods[method].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof method&&method?void $.error('Method "'+method+'" does not exist in fixedHeaderTable plugin!'):methods.init.apply(this,arguments)}}(jQuery); \ No newline at end of file +!function(t){t.fn.fixedHeaderTable=function(e){var i={width:"100%",height:"100%",themeClass:"fht-default",borderCollapse:!0,fixedColumns:0,fixedColumn:!1,sortable:!1,autoShow:!0,footer:!1,cloneHeadToFoot:!1,cloneEvents:!1,autoResize:!1,create:null},s={},d={init:function(e){return s=t.extend({},i,e),this.each(function(){var e=t(this);o._isTable(e)?(d.setup.apply(this,Array.prototype.slice.call(arguments,1)),t.isFunction(s.create)&&s.create.call(this)):t.error("Invalid table mark-up")})},setup:function(){var e,i,a,n,l,h=t(this),f=this,r=h.find("thead"),c=h.find("tfoot"),b=0;s.originalTable=t(this).clone(),s.includePadding=o._isPaddingIncludedWithWidth(),s.scrollbarOffset=o._getScrollbarWidth(),s.themeClassName=s.themeClass,l=s.width.search("%")>-1?h.parent().width()-s.scrollbarOffset:s.width-s.scrollbarOffset,h.css({width:l}),h.closest(".fht-table-wrapper").length||(h.addClass("fht-table"),h.wrap('
')),e=h.closest(".fht-table-wrapper"),1==s.fixedColumn&&s.fixedColumns<=0&&(s.fixedColumns=1),s.fixedColumns>0&&0==e.find(".fht-fixed-column").length&&(h.wrap('
'),t('
').prependTo(e),n=e.find(".fht-fixed-body")),e.css({width:s.width,height:s.height}).addClass(s.themeClassName),h.hasClass("fht-table-init")||h.wrap('
'),a=h.closest(".fht-tbody");var p=o._getTableProps(h);o._setupClone(a,p.tbody),h.hasClass("fht-table-init")?i=e.find("div.fht-thead"):(i=s.fixedColumns>0?t('
').prependTo(n):t('
').prependTo(e),i.find("table.fht-table").addClass(s.originalTable.attr("class")).attr("style",s.originalTable.attr("style")),r.clone(s.cloneEvents).appendTo(i.find("table"))),o._setupClone(i,p.thead),h.css({"margin-top":-i.outerHeight(!0)}),1==s.footer&&(o._setupTableFooter(h,f,p),c.length||(c=e.find("div.fht-tfoot table")),b=c.outerHeight(!0));var u=e.height()-r.outerHeight(!0)-b-p.border;return a.css({height:u}),h.addClass("fht-table-init"),"undefined"!=typeof s.altClass&&d.altRows.apply(f),s.fixedColumns>0&&o._setupFixedColumn(h,f,p),s.autoShow||e.hide(),o._bindScroll(a,p),f},resize:function(){var t=this;return t},altRows:function(e){var i=t(this),d="undefined"!=typeof e?e:s.altClass;i.closest(".fht-table-wrapper").find("tbody tr:odd:not(:hidden)").addClass(d)},show:function(e,i,s){var d=t(this),o=this,a=d.closest(".fht-table-wrapper");return"undefined"!=typeof e&&"number"==typeof e?(a.show(e,function(){t.isFunction(i)&&i.call(this)}),o):"undefined"!=typeof e&&"string"==typeof e&&"undefined"!=typeof i&&"number"==typeof i?(a.show(e,i,function(){t.isFunction(s)&&s.call(this)}),o):(d.closest(".fht-table-wrapper").show(),t.isFunction(e)&&e.call(this),o)},hide:function(e,i,s){var d=t(this),o=this,a=d.closest(".fht-table-wrapper");return"undefined"!=typeof e&&"number"==typeof e?(a.hide(e,function(){t.isFunction(s)&&s.call(this)}),o):"undefined"!=typeof e&&"string"==typeof e&&"undefined"!=typeof i&&"number"==typeof i?(a.hide(e,i,function(){t.isFunction(s)&&s.call(this)}),o):(d.closest(".fht-table-wrapper").hide(),t.isFunction(s)&&s.call(this),o)},destroy:function(){var e=t(this),i=this,s=e.closest(".fht-table-wrapper");return e.insertBefore(s).removeAttr("style").append(s.find("tfoot")).removeClass("fht-table fht-table-init").find(".fht-cell").remove(),s.remove(),i}},o={_isTable:function(t){var e=t,i=e.is("table"),s=e.find("thead").length>0,d=e.find("tbody").length>0;return!!(i&&s&&d)},_bindScroll:function(t){var e=t,i=e.closest(".fht-table-wrapper"),d=e.siblings(".fht-thead"),o=e.siblings(".fht-tfoot");e.bind("scroll",function(){if(s.fixedColumns>0){var t=i.find(".fht-fixed-column");t.find(".fht-tbody table").css({"margin-top":-e.scrollTop()})}d.find("table").css({"margin-left":-this.scrollLeft}),(s.footer||s.cloneHeadToFoot)&&o.find("table").css({"margin-left":-this.scrollLeft})})},_fixHeightWithCss:function(t,e){s.includePadding?t.css({height:t.height()+e.border}):t.css({height:t.parent().height()+e.border})},_fixWidthWithCss:function(e,i,d){s.includePadding?e.each(function(){t(this).css({width:void 0==d?t(this).width()+i.border:d+i.border})}):e.each(function(){t(this).css({width:void 0==d?t(this).parent().width()+i.border:d+i.border})})},_setupFixedColumn:function(e,i,d){var a,n,l,h,f,r=e,c=r.closest(".fht-table-wrapper"),b=c.find(".fht-fixed-body"),p=c.find(".fht-fixed-column"),u=t('
'),v=t('
'),g=t('
'),y=c.width(),w=b.find(".fht-tbody").height()-s.scrollbarOffset;u.find("table.fht-table").addClass(s.originalTable.attr("class")),v.find("table.fht-table").addClass(s.originalTable.attr("class")),g.find("table.fht-table").addClass(s.originalTable.attr("class")),a=b.find(".fht-thead thead tr > *:lt("+s.fixedColumns+")"),l=s.fixedColumns*d.border,a.each(function(){l+=t(this).outerWidth(!0)}),o._fixHeightWithCss(a,d),o._fixWidthWithCss(a,d);var C=[];a.each(function(){C.push(t(this).width())}),f="tbody tr > *:not(:nth-child(n+"+(s.fixedColumns+1)+"))",n=b.find(f).each(function(e){o._fixHeightWithCss(t(this),d),o._fixWidthWithCss(t(this),d,C[e%s.fixedColumns])}),u.appendTo(p).find("tr").append(a.clone(s.cloneEvents)),v.appendTo(p).css({"margin-top":-1,height:w+d.border}),n.each(function(e){e%s.fixedColumns==0&&(h=t("").appendTo(v.find("tbody")),s.altClass&&t(this).parent().hasClass(s.altClass)&&h.addClass(s.altClass)),t(this).clone(s.cloneEvents).appendTo(h)}),p.css({height:0,width:l});var m=p.find(".fht-tbody .fht-table").height()-p.find(".fht-tbody").height();if(p.find(".fht-tbody .fht-table").bind("mousewheel",function(e,i,s,d){if(0!=d){var o=parseInt(t(this).css("marginTop"),10)+(d>0?120:-120);return o>0&&(o=0),o<-m&&(o=-m),t(this).css("marginTop",o),b.find(".fht-tbody").scrollTop(-o).scroll(),!1}}),b.css({width:y}),1==s.footer||1==s.cloneHeadToFoot){var x,T=b.find(".fht-tfoot tr > *:lt("+s.fixedColumns+")");o._fixHeightWithCss(T,d),g.appendTo(p).find("tr").append(T.clone(s.cloneEvents)),x=g.find("table").innerWidth(),g.css({top:s.scrollbarOffset,width:x})}},_setupTableFooter:function(e,i,d){var a=e,n=a.closest(".fht-table-wrapper"),l=a.find("tfoot"),h=n.find("div.fht-tfoot");switch(h.length||(h=s.fixedColumns>0?t('
').appendTo(n.find(".fht-fixed-body")):t('
').appendTo(n)),h.find("table.fht-table").addClass(s.originalTable.attr("class")),!0){case!l.length&&1==s.cloneHeadToFoot&&1==s.footer:var f=n.find("div.fht-thead");h.empty(),f.find("table").clone(s.cloneEvents).appendTo(h);break;case l.length&&0==s.cloneHeadToFoot&&1==s.footer:h.find("table").append(l).css({"margin-top":-d.border}),o._setupClone(h,d.tfoot)}},_getTableProps:function(e){var i={thead:{},tbody:{},tfoot:{},border:0},d=1;return 1==s.borderCollapse&&(d=2),i.border=(e.find("th:first-child").outerWidth()-e.find("th:first-child").innerWidth())/d,e.find("thead tr:first-child > *").each(function(e){i.thead[e]=t(this).width()+i.border}),e.find("tfoot tr:first-child > *").each(function(e){i.tfoot[e]=t(this).width()+i.border}),e.find("tbody tr:first-child > *").each(function(e){i.tbody[e]=t(this).width()+i.border}),i},_setupClone:function(e,i){var d,o=e,a=o.find("thead").length?"thead tr:first-child > *":o.find("tfoot").length?"tfoot tr:first-child > *":"tbody tr:first-child > *";o.find(a).each(function(e){if(d=t(this).find("div.fht-cell").length?t(this).find("div.fht-cell"):t('
').appendTo(t(this)),d.css({width:parseInt(i[e],10)}),!t(this).closest(".fht-tbody").length&&t(this).is(":last-child")&&!t(this).closest(".fht-fixed-column").length){var o=Math.max((t(this).innerWidth()-t(this).width())/2,s.scrollbarOffset);t(this).css({"padding-right":parseInt(t(this).css("padding-right"))+o+"px"})}})},_isPaddingIncludedWithWidth:function(){var e,i,d=t('
test
');return d.addClass(s.originalTable.attr("class")),d.appendTo("body"),e=d.find("td").height(),d.find("td").css("height",d.find("tr").height()),i=d.find("td").height(),d.remove(),e!=i},_getScrollbarWidth:function(){var e=0;if(!e)if(/msie/.test(navigator.userAgent.toLowerCase())){var i=t('').css({position:"absolute",top:-1e3,left:-1e3}).appendTo("body"),s=t('').css({position:"absolute",top:-1e3,left:-1e3}).appendTo("body");e=i.width()-s.width()+2,i.add(s).remove()}else{var d=t("
").css({width:100,height:100,overflow:"auto",position:"absolute",top:-1e3,left:-1e3}).prependTo("body").append("
").find("div").css({width:"100%",height:200});e=100-d.width(),d.parent().remove()}return e}};return d[e]?d[e].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof e&&e?void t.error('Method "'+e+'" does not exist in fixedHeaderTable plugin!'):d.init.apply(this,arguments)}}(jQuery); \ No newline at end of file From f12fad6e18d87364a59e40a49a13fead8cac946b Mon Sep 17 00:00:00 2001 From: Giordano Battilana Date: Thu, 20 Oct 2016 11:17:36 +0200 Subject: [PATCH 4/5] further minified version (mangled names) --- jquery.fixedheadertable.min.js | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/jquery.fixedheadertable.min.js b/jquery.fixedheadertable.min.js index f8ed503..49c7448 100644 --- a/jquery.fixedheadertable.min.js +++ b/jquery.fixedheadertable.min.js @@ -1 +1,19 @@ -!function($){$.fn.fixedHeaderTable=function(method){var defaults={width:"100%",height:"100%",themeClass:"fht-default",borderCollapse:!0,fixedColumns:0,fixedColumn:!1,sortable:!1,autoShow:!0,footer:!1,cloneHeadToFoot:!1,cloneEvents:!1,autoResize:!1,create:null},settings={},methods={init:function(options){return settings=$.extend({},defaults,options),this.each(function(){var $self=$(this);helpers._isTable($self)?(methods.setup.apply(this,Array.prototype.slice.call(arguments,1)),$.isFunction(settings.create)&&settings.create.call(this)):$.error("Invalid table mark-up")})},setup:function(){var $wrapper,$divHead,$divBody,$fixedBody,widthMinusScrollbar,$self=$(this),self=this,$thead=$self.find("thead"),$tfoot=$self.find("tfoot"),tfootHeight=0;settings.originalTable=$(this).clone(),settings.includePadding=helpers._isPaddingIncludedWithWidth(),settings.scrollbarOffset=helpers._getScrollbarWidth(),settings.themeClassName=settings.themeClass,widthMinusScrollbar=settings.width.search("%")>-1?$self.parent().width()-settings.scrollbarOffset:settings.width-settings.scrollbarOffset,$self.css({width:widthMinusScrollbar}),$self.closest(".fht-table-wrapper").length||($self.addClass("fht-table"),$self.wrap('
')),$wrapper=$self.closest(".fht-table-wrapper"),1==settings.fixedColumn&&settings.fixedColumns<=0&&(settings.fixedColumns=1),settings.fixedColumns>0&&0==$wrapper.find(".fht-fixed-column").length&&($self.wrap('
'),$('
').prependTo($wrapper),$fixedBody=$wrapper.find(".fht-fixed-body")),$wrapper.css({width:settings.width,height:settings.height}).addClass(settings.themeClassName),$self.hasClass("fht-table-init")||$self.wrap('
'),$divBody=$self.closest(".fht-tbody");var tableProps=helpers._getTableProps($self);helpers._setupClone($divBody,tableProps.tbody),$self.hasClass("fht-table-init")?$divHead=$wrapper.find("div.fht-thead"):($divHead=settings.fixedColumns>0?$('
').prependTo($fixedBody):$('
').prependTo($wrapper),$divHead.find("table.fht-table").addClass(settings.originalTable.attr("class")).attr("style",settings.originalTable.attr("style")),$thead.clone(settings.cloneEvents).appendTo($divHead.find("table"))),helpers._setupClone($divHead,tableProps.thead),$self.css({"margin-top":-$divHead.outerHeight(!0)}),1==settings.footer&&(helpers._setupTableFooter($self,self,tableProps),$tfoot.length||($tfoot=$wrapper.find("div.fht-tfoot table")),tfootHeight=$tfoot.outerHeight(!0));var tbodyHeight=$wrapper.height()-$thead.outerHeight(!0)-tfootHeight-tableProps.border;return $divBody.css({height:tbodyHeight}),$self.addClass("fht-table-init"),"undefined"!=typeof settings.altClass&&methods.altRows.apply(self),settings.fixedColumns>0&&helpers._setupFixedColumn($self,self,tableProps),settings.autoShow||$wrapper.hide(),helpers._bindScroll($divBody,tableProps),self},resize:function(){var self=this;return self},altRows:function(arg1){var $self=$(this),altClass="undefined"!=typeof arg1?arg1:settings.altClass;$self.closest(".fht-table-wrapper").find("tbody tr:odd:not(:hidden)").addClass(altClass)},show:function(arg1,arg2,arg3){var $self=$(this),self=this,$wrapper=$self.closest(".fht-table-wrapper");return"undefined"!=typeof arg1&&"number"==typeof arg1?($wrapper.show(arg1,function(){$.isFunction(arg2)&&arg2.call(this)}),self):"undefined"!=typeof arg1&&"string"==typeof arg1&&"undefined"!=typeof arg2&&"number"==typeof arg2?($wrapper.show(arg1,arg2,function(){$.isFunction(arg3)&&arg3.call(this)}),self):($self.closest(".fht-table-wrapper").show(),$.isFunction(arg1)&&arg1.call(this),self)},hide:function(arg1,arg2,arg3){var $self=$(this),self=this,$wrapper=$self.closest(".fht-table-wrapper");return"undefined"!=typeof arg1&&"number"==typeof arg1?($wrapper.hide(arg1,function(){$.isFunction(arg3)&&arg3.call(this)}),self):"undefined"!=typeof arg1&&"string"==typeof arg1&&"undefined"!=typeof arg2&&"number"==typeof arg2?($wrapper.hide(arg1,arg2,function(){$.isFunction(arg3)&&arg3.call(this)}),self):($self.closest(".fht-table-wrapper").hide(),$.isFunction(arg3)&&arg3.call(this),self)},destroy:function(){var $self=$(this),self=this,$wrapper=$self.closest(".fht-table-wrapper");return $self.insertBefore($wrapper).removeAttr("style").append($wrapper.find("tfoot")).removeClass("fht-table fht-table-init").find(".fht-cell").remove(),$wrapper.remove(),self}},helpers={_isTable:function($obj){var $self=$obj,hasTable=$self.is("table"),hasThead=$self.find("thead").length>0,hasTbody=$self.find("tbody").length>0;return!!(hasTable&&hasThead&&hasTbody)},_bindScroll:function($obj){var $self=$obj,$wrapper=$self.closest(".fht-table-wrapper"),$thead=$self.siblings(".fht-thead"),$tfoot=$self.siblings(".fht-tfoot");$self.bind("scroll",function(){if(settings.fixedColumns>0){var $fixedColumns=$wrapper.find(".fht-fixed-column");$fixedColumns.find(".fht-tbody table").css({"margin-top":-$self.scrollTop()})}$thead.find("table").css({"margin-left":-this.scrollLeft}),(settings.footer||settings.cloneHeadToFoot)&&$tfoot.find("table").css({"margin-left":-this.scrollLeft})})},_fixHeightWithCss:function($obj,tableProps){settings.includePadding?$obj.css({height:$obj.height()+tableProps.border}):$obj.css({height:$obj.parent().height()+tableProps.border})},_fixWidthWithCss:function($obj,tableProps,width){settings.includePadding?$obj.each(function(){$(this).css({width:void 0==width?$(this).width()+tableProps.border:width+tableProps.border})}):$obj.each(function(){$(this).css({width:void 0==width?$(this).parent().width()+tableProps.border:width+tableProps.border})})},_setupFixedColumn:function($obj,obj,tableProps){var $firstThChildren,$firstTdChildren,fixedColumnWidth,$newRow,firstTdChildrenSelector,$self=$obj,$wrapper=$self.closest(".fht-table-wrapper"),$fixedBody=$wrapper.find(".fht-fixed-body"),$fixedColumn=$wrapper.find(".fht-fixed-column"),$thead=$('
'),$tbody=$('
'),$tfoot=$('
'),fixedBodyWidth=$wrapper.width(),fixedBodyHeight=$fixedBody.find(".fht-tbody").height()-settings.scrollbarOffset;$thead.find("table.fht-table").addClass(settings.originalTable.attr("class")),$tbody.find("table.fht-table").addClass(settings.originalTable.attr("class")),$tfoot.find("table.fht-table").addClass(settings.originalTable.attr("class")),$firstThChildren=$fixedBody.find(".fht-thead thead tr > *:lt("+settings.fixedColumns+")"),fixedColumnWidth=settings.fixedColumns*tableProps.border,$firstThChildren.each(function(){fixedColumnWidth+=$(this).outerWidth(!0)}),helpers._fixHeightWithCss($firstThChildren,tableProps),helpers._fixWidthWithCss($firstThChildren,tableProps);var tdWidths=[];$firstThChildren.each(function(){tdWidths.push($(this).width())}),firstTdChildrenSelector="tbody tr > *:not(:nth-child(n+"+(settings.fixedColumns+1)+"))",$firstTdChildren=$fixedBody.find(firstTdChildrenSelector).each(function(index){helpers._fixHeightWithCss($(this),tableProps),helpers._fixWidthWithCss($(this),tableProps,tdWidths[index%settings.fixedColumns])}),$thead.appendTo($fixedColumn).find("tr").append($firstThChildren.clone(settings.cloneEvents)),$tbody.appendTo($fixedColumn).css({"margin-top":-1,height:fixedBodyHeight+tableProps.border}),$firstTdChildren.each(function(index){index%settings.fixedColumns==0&&($newRow=$("").appendTo($tbody.find("tbody")),settings.altClass&&$(this).parent().hasClass(settings.altClass)&&$newRow.addClass(settings.altClass)),$(this).clone(settings.cloneEvents).appendTo($newRow)}),$fixedColumn.css({height:0,width:fixedColumnWidth});var maxTop=$fixedColumn.find(".fht-tbody .fht-table").height()-$fixedColumn.find(".fht-tbody").height();if($fixedColumn.find(".fht-tbody .fht-table").bind("mousewheel",function(event,delta,deltaX,deltaY){if(0!=deltaY){var top=parseInt($(this).css("marginTop"),10)+(deltaY>0?120:-120);return top>0&&(top=0),top<-maxTop&&(top=-maxTop),$(this).css("marginTop",top),$fixedBody.find(".fht-tbody").scrollTop(-top).scroll(),!1}}),$fixedBody.css({width:fixedBodyWidth}),1==settings.footer||1==settings.cloneHeadToFoot){var footwidth,$firstTdFootChild=$fixedBody.find(".fht-tfoot tr > *:lt("+settings.fixedColumns+")");helpers._fixHeightWithCss($firstTdFootChild,tableProps),$tfoot.appendTo($fixedColumn).find("tr").append($firstTdFootChild.clone(settings.cloneEvents)),footwidth=$tfoot.find("table").innerWidth(),$tfoot.css({top:settings.scrollbarOffset,width:footwidth})}},_setupTableFooter:function($obj,obj,tableProps){var $self=$obj,$wrapper=$self.closest(".fht-table-wrapper"),$tfoot=$self.find("tfoot"),$divFoot=$wrapper.find("div.fht-tfoot");switch($divFoot.length||($divFoot=settings.fixedColumns>0?$('
').appendTo($wrapper.find(".fht-fixed-body")):$('
').appendTo($wrapper)),$divFoot.find("table.fht-table").addClass(settings.originalTable.attr("class")),!0){case!$tfoot.length&&1==settings.cloneHeadToFoot&&1==settings.footer:var $divHead=$wrapper.find("div.fht-thead");$divFoot.empty(),$divHead.find("table").clone(settings.cloneEvents).appendTo($divFoot);break;case $tfoot.length&&0==settings.cloneHeadToFoot&&1==settings.footer:$divFoot.find("table").append($tfoot).css({"margin-top":-tableProps.border}),helpers._setupClone($divFoot,tableProps.tfoot)}},_getTableProps:function($obj){var tableProp={thead:{},tbody:{},tfoot:{},border:0},borderCollapse=1;return 1==settings.borderCollapse&&(borderCollapse=2),tableProp.border=($obj.find("th:first-child").outerWidth()-$obj.find("th:first-child").innerWidth())/borderCollapse,$obj.find("thead tr:first-child > *").each(function(index){tableProp.thead[index]=$(this).width()+tableProp.border}),$obj.find("tfoot tr:first-child > *").each(function(index){tableProp.tfoot[index]=$(this).width()+tableProp.border}),$obj.find("tbody tr:first-child > *").each(function(index){tableProp.tbody[index]=$(this).width()+tableProp.border}),tableProp},_setupClone:function($obj,cellArray){var $cell,$self=$obj,selector=$self.find("thead").length?"thead tr:first-child > *":$self.find("tfoot").length?"tfoot tr:first-child > *":"tbody tr:first-child > *";$self.find(selector).each(function(index){if($cell=$(this).find("div.fht-cell").length?$(this).find("div.fht-cell"):$('
').appendTo($(this)),$cell.css({width:parseInt(cellArray[index],10)}),!$(this).closest(".fht-tbody").length&&$(this).is(":last-child")&&!$(this).closest(".fht-fixed-column").length){var padding=Math.max(($(this).innerWidth()-$(this).width())/2,settings.scrollbarOffset);$(this).css({"padding-right":parseInt($(this).css("padding-right"))+padding+"px"})}})},_isPaddingIncludedWithWidth:function(){var defaultHeight,newHeight,$obj=$('
test
');return $obj.addClass(settings.originalTable.attr("class")),$obj.appendTo("body"),defaultHeight=$obj.find("td").height(),$obj.find("td").css("height",$obj.find("tr").height()),newHeight=$obj.find("td").height(),$obj.remove(),defaultHeight!=newHeight},_getScrollbarWidth:function(){var scrollbarWidth=0;if(!scrollbarWidth)if(/msie/.test(navigator.userAgent.toLowerCase())){var $textarea1=$('').css({position:"absolute",top:-1e3,left:-1e3}).appendTo("body"),$textarea2=$('').css({position:"absolute",top:-1e3,left:-1e3}).appendTo("body");scrollbarWidth=$textarea1.width()-$textarea2.width()+2,$textarea1.add($textarea2).remove()}else{var $div=$("
").css({width:100,height:100,overflow:"auto",position:"absolute",top:-1e3,left:-1e3}).prependTo("body").append("
").find("div").css({width:"100%",height:200});scrollbarWidth=100-$div.width(),$div.parent().remove()}return scrollbarWidth}};return methods[method]?methods[method].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof method&&method?void $.error('Method "'+method+'" does not exist in fixedHeaderTable plugin!'):methods.init.apply(this,arguments)}}(jQuery); \ No newline at end of file +/*! + * jquery.fixedHeaderTable. The jQuery fixedHeaderTable plugin + * + * Copyright (c) 2013 Mark Malek + * http://fixedheadertable.com + * + * Licensed under MIT + * http://www.opensource.org/licenses/mit-license.php + * + * http://docs.jquery.com/Plugins/Authoring + * jQuery authoring guidelines + * + * Launch : October 2009 + * Version : 1.3 + * Released: May 9th, 2011 + * + * + * all CSS sizing (width,height) is done in pixels (px) + */!function(t){t.fn.fixedHeaderTable=function(e){var i={width:"100%",height:"100%",themeClass:"fht-default",borderCollapse:!0,fixedColumns:0,fixedColumn:!1,sortable:!1,autoShow:!0,footer:!1,cloneHeadToFoot:!1,cloneEvents:!1,autoResize:!1,create:null},s={},d={init:function(e){return s=t.extend({},i,e),this.each(function(){var e=t(this);o._isTable(e)?(d.setup.apply(this,Array.prototype.slice.call(arguments,1)),t.isFunction(s.create)&&s.create.call(this)):t.error("Invalid table mark-up")})},setup:function(){var e,i,a,n,l,h=t(this),f=this,r=h.find("thead"),c=h.find("tfoot"),b=0;s.originalTable=t(this).clone(),s.includePadding=o._isPaddingIncludedWithWidth(),s.scrollbarOffset=o._getScrollbarWidth(),s.themeClassName=s.themeClass,l=s.width.search("%")>-1?h.parent().width()-s.scrollbarOffset:s.width-s.scrollbarOffset,h.css({width:l}),h.closest(".fht-table-wrapper").length||(h.addClass("fht-table"),h.wrap('
')),e=h.closest(".fht-table-wrapper"),1==s.fixedColumn&&s.fixedColumns<=0&&(s.fixedColumns=1),s.fixedColumns>0&&0==e.find(".fht-fixed-column").length&&(h.wrap('
'),t('
').prependTo(e),n=e.find(".fht-fixed-body")),e.css({width:s.width,height:s.height}).addClass(s.themeClassName),h.hasClass("fht-table-init")||h.wrap('
'),a=h.closest(".fht-tbody");var p=o._getTableProps(h);o._setupClone(a,p.tbody),h.hasClass("fht-table-init")?i=e.find("div.fht-thead"):(i=s.fixedColumns>0?t('
').prependTo(n):t('
').prependTo(e),i.find("table.fht-table").addClass(s.originalTable.attr("class")).attr("style",s.originalTable.attr("style")),r.clone(s.cloneEvents).appendTo(i.find("table"))),o._setupClone(i,p.thead),h.css({"margin-top":-i.outerHeight(!0)}),1==s.footer&&(o._setupTableFooter(h,f,p),c.length||(c=e.find("div.fht-tfoot table")),b=c.outerHeight(!0));var u=e.height()-r.outerHeight(!0)-b-p.border;return a.css({height:u}),h.addClass("fht-table-init"),"undefined"!=typeof s.altClass&&d.altRows.apply(f),s.fixedColumns>0&&o._setupFixedColumn(h,f,p),s.autoShow||e.hide(),o._bindScroll(a,p),f},resize:function(){var t=this;return t},altRows:function(e){var i=t(this),d="undefined"!=typeof e?e:s.altClass;i.closest(".fht-table-wrapper").find("tbody tr:odd:not(:hidden)").addClass(d)},show:function(e,i,s){var d=t(this),o=this,a=d.closest(".fht-table-wrapper");return"undefined"!=typeof e&&"number"==typeof e?(a.show(e,function(){t.isFunction(i)&&i.call(this)}),o):"undefined"!=typeof e&&"string"==typeof e&&"undefined"!=typeof i&&"number"==typeof i?(a.show(e,i,function(){t.isFunction(s)&&s.call(this)}),o):(d.closest(".fht-table-wrapper").show(),t.isFunction(e)&&e.call(this),o)},hide:function(e,i,s){var d=t(this),o=this,a=d.closest(".fht-table-wrapper");return"undefined"!=typeof e&&"number"==typeof e?(a.hide(e,function(){t.isFunction(s)&&s.call(this)}),o):"undefined"!=typeof e&&"string"==typeof e&&"undefined"!=typeof i&&"number"==typeof i?(a.hide(e,i,function(){t.isFunction(s)&&s.call(this)}),o):(d.closest(".fht-table-wrapper").hide(),t.isFunction(s)&&s.call(this),o)},destroy:function(){var e=t(this),i=this,s=e.closest(".fht-table-wrapper");return e.insertBefore(s).removeAttr("style").append(s.find("tfoot")).removeClass("fht-table fht-table-init").find(".fht-cell").remove(),s.remove(),i}},o={_isTable:function(t){var e=t,i=e.is("table"),s=e.find("thead").length>0,d=e.find("tbody").length>0;return!!(i&&s&&d)},_bindScroll:function(t){var e=t,i=e.closest(".fht-table-wrapper"),d=e.siblings(".fht-thead"),o=e.siblings(".fht-tfoot");e.bind("scroll",function(){if(s.fixedColumns>0){var t=i.find(".fht-fixed-column");t.find(".fht-tbody table").css({"margin-top":-e.scrollTop()})}d.find("table").css({"margin-left":-this.scrollLeft}),(s.footer||s.cloneHeadToFoot)&&o.find("table").css({"margin-left":-this.scrollLeft})})},_fixHeightWithCss:function(t,e){s.includePadding?t.css({height:t.height()+e.border}):t.css({height:t.parent().height()+e.border})},_fixWidthWithCss:function(e,i,d){s.includePadding?e.each(function(){t(this).css({width:void 0==d?t(this).width()+i.border:d+i.border})}):e.each(function(){t(this).css({width:void 0==d?t(this).parent().width()+i.border:d+i.border})})},_setupFixedColumn:function(e,i,d){var a,n,l,h,f,r=e,c=r.closest(".fht-table-wrapper"),b=c.find(".fht-fixed-body"),p=c.find(".fht-fixed-column"),u=t('
'),v=t('
'),g=t('
'),y=c.width(),w=b.find(".fht-tbody").height()-s.scrollbarOffset;u.find("table.fht-table").addClass(s.originalTable.attr("class")),v.find("table.fht-table").addClass(s.originalTable.attr("class")),g.find("table.fht-table").addClass(s.originalTable.attr("class")),a=b.find(".fht-thead thead tr > *:lt("+s.fixedColumns+")"),l=s.fixedColumns*d.border,a.each(function(){l+=t(this).outerWidth(!0)}),o._fixHeightWithCss(a,d),o._fixWidthWithCss(a,d);var C=[];a.each(function(){C.push(t(this).width())}),f="tbody tr > *:not(:nth-child(n+"+(s.fixedColumns+1)+"))",n=b.find(f).each(function(e){o._fixHeightWithCss(t(this),d),o._fixWidthWithCss(t(this),d,C[e%s.fixedColumns])}),u.appendTo(p).find("tr").append(a.clone(s.cloneEvents)),v.appendTo(p).css({"margin-top":-1,height:w+d.border}),n.each(function(e){e%s.fixedColumns==0&&(h=t("").appendTo(v.find("tbody")),s.altClass&&t(this).parent().hasClass(s.altClass)&&h.addClass(s.altClass)),t(this).clone(s.cloneEvents).appendTo(h)}),p.css({height:0,width:l});var m=p.find(".fht-tbody .fht-table").height()-p.find(".fht-tbody").height();if(p.find(".fht-tbody .fht-table").bind("mousewheel",function(e,i,s,d){if(0!=d){var o=parseInt(t(this).css("marginTop"),10)+(d>0?120:-120);return o>0&&(o=0),o<-m&&(o=-m),t(this).css("marginTop",o),b.find(".fht-tbody").scrollTop(-o).scroll(),!1}}),b.css({width:y}),1==s.footer||1==s.cloneHeadToFoot){var x,T=b.find(".fht-tfoot tr > *:lt("+s.fixedColumns+")");o._fixHeightWithCss(T,d),g.appendTo(p).find("tr").append(T.clone(s.cloneEvents)),x=g.find("table").innerWidth(),g.css({top:s.scrollbarOffset,width:x})}},_setupTableFooter:function(e,i,d){var a=e,n=a.closest(".fht-table-wrapper"),l=a.find("tfoot"),h=n.find("div.fht-tfoot");switch(h.length||(h=s.fixedColumns>0?t('
').appendTo(n.find(".fht-fixed-body")):t('
').appendTo(n)),h.find("table.fht-table").addClass(s.originalTable.attr("class")),!0){case!l.length&&1==s.cloneHeadToFoot&&1==s.footer:var f=n.find("div.fht-thead");h.empty(),f.find("table").clone(s.cloneEvents).appendTo(h);break;case l.length&&0==s.cloneHeadToFoot&&1==s.footer:h.find("table").append(l).css({"margin-top":-d.border}),o._setupClone(h,d.tfoot)}},_getTableProps:function(e){var i={thead:{},tbody:{},tfoot:{},border:0},d=1;return 1==s.borderCollapse&&(d=2),i.border=(e.find("th:first-child").outerWidth()-e.find("th:first-child").innerWidth())/d,e.find("thead tr:first-child > *").each(function(e){i.thead[e]=t(this).width()+i.border}),e.find("tfoot tr:first-child > *").each(function(e){i.tfoot[e]=t(this).width()+i.border}),e.find("tbody tr:first-child > *").each(function(e){i.tbody[e]=t(this).width()+i.border}),i},_setupClone:function(e,i){var d,o=e,a=o.find("thead").length?"thead tr:first-child > *":o.find("tfoot").length?"tfoot tr:first-child > *":"tbody tr:first-child > *";o.find(a).each(function(e){if(d=t(this).find("div.fht-cell").length?t(this).find("div.fht-cell"):t('
').appendTo(t(this)),d.css({width:parseInt(i[e],10)}),!t(this).closest(".fht-tbody").length&&t(this).is(":last-child")&&!t(this).closest(".fht-fixed-column").length){var o=Math.max((t(this).innerWidth()-t(this).width())/2,s.scrollbarOffset);t(this).css({"padding-right":parseInt(t(this).css("padding-right"))+o+"px"})}})},_isPaddingIncludedWithWidth:function(){var e,i,d=t('
test
');return d.addClass(s.originalTable.attr("class")),d.appendTo("body"),e=d.find("td").height(),d.find("td").css("height",d.find("tr").height()),i=d.find("td").height(),d.remove(),e!=i},_getScrollbarWidth:function(){var e=0;if(!e)if(/msie/.test(navigator.userAgent.toLowerCase())){var i=t('').css({position:"absolute",top:-1e3,left:-1e3}).appendTo("body"),s=t('').css({position:"absolute",top:-1e3,left:-1e3}).appendTo("body");e=i.width()-s.width()+2,i.add(s).remove()}else{var d=t("
").css({width:100,height:100,overflow:"auto",position:"absolute",top:-1e3,left:-1e3}).prependTo("body").append("
").find("div").css({width:"100%",height:200});e=100-d.width(),d.parent().remove()}return e}};return d[e]?d[e].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof e&&e?void t.error('Method "'+e+'" does not exist in fixedHeaderTable plugin!'):d.init.apply(this,arguments)}}(jQuery); From 46d1631d5147365d0a1fe7c432cb0b23585f8e3e Mon Sep 17 00:00:00 2001 From: Giordano Battilana Date: Thu, 20 Oct 2016 11:31:50 +0200 Subject: [PATCH 5/5] updated README --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d5e1239..c80ff36 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,7 @@ * fixedColumns - Number - Default: 0 * footer - Boolean - Default: false * cloneHeadToFoot - Boolean - Default: false +* cloneEvents - Boolean - Default: false * autoShow - Boolean - Default: true * altClass - String - Default: none * themeClass - String - Default: none @@ -22,4 +23,4 @@ If you aren't using the minified version, be sure to include `lib/jquery.mousewheel.js` in your page if you require mousewheel -scrolling via fixed columns. \ No newline at end of file +scrolling via fixed columns.