/* * File: FixedColumns.min.js * Version: 2.0.2 * Author: Allan Jardine (www.sprymedia.co.uk) * * Copyright 2010-2010 Allan Jardine, all rights reserved. * * This source file is free software, under either the GPL v2 license or a * BSD style license, available at: * http://datatables.net/license_gpl2 * http://datatables.net/license_bsd * * This source file is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the license files for details. */ /* GPL v2 or BSD 3 point style @contact www.sprymedia.co.uk/contact @copyright Copyright 2010-2011 Allan Jardine, all rights reserved. This source file is free software, under either the GPL v2 license or a BSD style license, available at: http://datatables.net/license_gpl2 http://datatables.net/license_bsd */ var FixedColumns; (function(c,m){FixedColumns=function(a,d){!this instanceof FixedColumns?alert("FixedColumns warning: FixedColumns must be initialised with the 'new' keyword."):("undefined"==typeof d&&(d={}),this.s={dt:a.fnSettings(),iTableColumns:a.fnSettings().aoColumns.length,aiWidths:[],bOldIE:c.browser.msie&&("6.0"==c.browser.version||"7.0"==c.browser.version)},this.dom={scroller:null,header:null,body:null,footer:null,grid:{wrapper:null,dt:null,left:{wrapper:null,head:null,body:null,foot:null},right:{wrapper:null, head:null,body:null,foot:null}},clone:{left:{header:null,body:null,footer:null},right:{header:null,body:null,footer:null}}},this.s.dt.oFixedColumns=this,this._fnConstruct(d))};FixedColumns.prototype={fnUpdate:function(){this._fnDraw(!0)},fnRedrawLayout:function(){this._fnGridLayout()},fnRecalculateHeight:function(a){a._DTTC_iHeight=null;a.style.height="auto"},fnSetRowHeight:function(a,d){var b=c(a).children(":first"),b=b.outerHeight()-b.height();c.browser.mozilla||c.browser.opera?a.style.height=d+ "px":c(a).children().height(d-b)},_fnConstruct:function(a){var d,b=this;if("function"!=typeof this.s.dt.oInstance.fnVersionCheck||!0!==this.s.dt.oInstance.fnVersionCheck("1.8.0"))alert("FixedColumns "+FixedColumns.VERSION+" required DataTables 1.8.0 or later. Please upgrade your DataTables installation");else if(""===this.s.dt.oScroll.sX)this.s.dt.oInstance.oApi._fnLog(this.s.dt,1,"FixedColumns is not needed (no x-scrolling in DataTables enabled), so no action will be taken. Use 'FixedHeader' for column fixing when scrolling is not enabled"); else{this.s=c.extend(!0,this.s,FixedColumns.defaults,a);this.dom.grid.dt=c(this.s.dt.nTable).parents("div.dataTables_scroll")[0];this.dom.scroller=c("div.dataTables_scrollBody",this.dom.grid.dt)[0];var a=c(this.dom.grid.dt).width(),f=0,g=0;c("tbody>tr:eq(0)>td",this.s.dt.nTable).each(function(a){d=c(this).outerWidth();b.s.aiWidths.push(d);a
')[0]; nLeft=a.childNodes[0];nRight=a.childNodes[1];this.dom.grid.wrapper=a;this.dom.grid.left.wrapper=nLeft;this.dom.grid.left.head=nLeft.childNodes[0];this.dom.grid.left.body=nLeft.childNodes[1];if(0=this.s.iRightColumns)){var c,b=[];for(c=this.s.iTableColumns-this.s.iRightColumns;c=this.s.iLeftColumns)){var c,b=[];for(c=0;cthead",a.header);o.empty();for(e=0,k=j.length;ethead th:eq("+ h+")",a.header)[0].className=this.s.dt.aoColumns[b[h]].nTh.className,c(">thead th:eq("+h+") span.DataTables_sort_icon",a.header).each(function(a){this.className=c("span.DataTables_sort_icon",g.s.dt.aoColumns[b[h]].nTh)[a].className});this._fnEqualiseHeights("thead",this.dom.header,a.header);"auto"==this.s.sHeightMatch&&c(">tbody>tr",g.dom.body).css("height","auto");if(null!==a.body)a.body.parentNode.removeChild(a.body),a.body=null;a.body=c(this.dom.body).clone(!0)[0];a.body.className+=" DTFC_Cloned"; a.body.style.paddingBottom=this.s.dt.oScroll.iBarWidth+"px";a.body.style.marginBottom=2*this.s.dt.oScroll.iBarWidth+"px";null!==a.body.getAttribute("id")&&a.body.removeAttribute("id");c(">thead>tr",a.body).empty();c(">tfoot",a.body).empty();var n=c("tbody",a.body)[0];c(n).empty();0tbody>tr",g.dom.body).each(function(a){var d=this.cloneNode(!1),a=!1===g.s.dt.oFeatures.bServerSide?g.s.dt.aiDisplay[g.s.dt._iDisplayStart+a]:a;for(h=0;htbody>tr",g.dom.body).each(function(){i=this.cloneNode(!0);i.className+=" DTFC_NoData";c("td",i).html("");n.appendChild(i)});a.body.style.width="100%";d.body.appendChild(a.body);this._fnEqualiseHeights("tbody",g.dom.body,a.body);if(null!==this.s.dt.nTFoot){if(f){null!==a.footer&&a.footer.parentNode.removeChild(a.footer);a.footer=c(this.dom.footer).clone(!0)[0]; a.footer.className+=" DTFC_Cloned";a.footer.style.width="100%";d.foot.appendChild(a.footer);j=this._fnCopyLayout(this.s.dt.aoFooter,b);d=c(">tfoot",a.footer);d.empty();for(e=0,k=j.length;etfoot th:eq("+h+")",a.footer)[0].className=this.s.dt.aoColumns[b[h]].nTf.className;this._fnEqualiseHeights("tfoot",this.dom.footer,a.footer)}e=c(">tbody>tr:eq(0)",a.body);var m=c(">thead>tr:eq(0)",a.header); if(null!==this.s.dt.nTFoot)var p=c(">tfoot>tr:eq(0)",a.footer);e.children().each(function(a){var b=c(this).width();m.children(":eq("+a+")").width(b);null!==g.s.dt.nTFoot&&p.children(":eq("+a+")").width(b)})},_fnGetTrNodes:function(a){for(var c=[],b=0,f=a.childNodes.length;b"+a+">tr:eq(0)",d).children(":first"),a=a.outerHeight()-a.height(),e=this._fnGetTrNodes(e),k=this._fnGetTrNodes(b);for(b=0,d=k.length;bf?g:f;if("semiauto"==this.s.sHeightMatch)e[b]._DTTC_iHeight=f;c.browser.msie&&8>c.browser.version?(c(k[b]).children().height(f-a),c(e[b]).children().height(f- a)):(k[b].style.height=f+"px",e[b].style.height=f+"px")}}}};FixedColumns.defaults={iLeftColumns:1,iRightColumns:0,fnDrawCallback:null,sLeftWidth:"fixed",iLeftWidth:null,sRightWidth:"fixed",iRightWidth:null,sHeightMatch:"semiauto"};FixedColumns.prototype.CLASS="FixedColumns";FixedColumns.VERSION="2.0.2"})(jQuery,window,document);