All Downloads are FREE. Search and download functionalities are using the official Maven repository.

META-INF.resources.bower_components.datatables.net-fixedcolumns.js.dataTables.fixedColumns.min.js Maven / Gradle / Ivy

The newest version!
/*! FixedColumns 3.2.6
 * ©2010-2018 SpryMedia Ltd - datatables.net/license
 */
(function(a){if(typeof define==="function"&&define.amd){define(["jquery","datatables.net"],function(b){return a(b,window,document)})}else{if(typeof exports==="object"){module.exports=function(b,c){if(!b){b=window}if(!c||!c.fn.dataTable){c=require("datatables.net")(b,c).$}return a(c,b,b.document)}}else{a(jQuery,window,document)}}}(function(f,d,a,g){var e=f.fn.dataTable;var b;var c=function(j,l){var i=this;if(!(this instanceof c)){alert("FixedColumns warning: FixedColumns must be initialised with the 'new' keyword.");return}if(l===g||l===true){l={}}var h=f.fn.dataTable.camelToHungarian;if(h){h(c.defaults,c.defaults,true);h(c.defaults,l)}var k=new f.fn.dataTable.Api(j).settings()[0];this.s={dt:k,iTableColumns:k.aoColumns.length,aiOuterWidths:[],aiInnerWidths:[],rtl:f(k.nTable).css("direction")==="rtl"};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}}};if(k._oFixedColumns){throw"FixedColumns already initialised on this table"}k._oFixedColumns=this;if(!k._bInitComplete){k.oApi._fnCallbackReg(k,"aoInitComplete",function(){i._fnConstruct(l)},"FixedColumns")}else{this._fnConstruct(l)}};f.extend(c.prototype,{fnUpdate:function(){this._fnDraw(true)},fnRedrawLayout:function(){this._fnColCalc();this._fnGridLayout();this.fnUpdate()},fnRecalculateHeight:function(h){delete h._DTTC_iHeight;h.style.height="auto"},fnSetRowHeight:function(i,h){i.style.height=h+"px"},fnGetPosition:function(i){var h;var j=this.s.dt.oInstance;if(!f(i).parents(".DTFC_Cloned").length){return j.fnGetPosition(i)}else{if(i.nodeName.toLowerCase()==="tr"){h=f(i).index();return j.fnGetPosition(f("tr",this.s.dt.nTBody)[h])}else{var l=f(i).index();h=f(i.parentNode).index();var k=j.fnGetPosition(f("tr",this.s.dt.nTBody)[h]);return[k,l,j.oApi._fnVisibleToColumnIndex(this.s.dt,l)]}}},_fnConstruct:function(q){var m,j,h,p=this;if(typeof this.s.dt.oInstance.fnVersionCheck!="function"||this.s.dt.oInstance.fnVersionCheck("1.8.0")!==true){alert("FixedColumns "+c.VERSION+" required DataTables 1.8.0 or later. Please upgrade your DataTables installation");return}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");return}this.s=f.extend(true,this.s,c.defaults,q);var l=this.s.dt.oClasses;this.dom.grid.dt=f(this.s.dt.nTable).parents("div."+l.sScrollWrapper)[0];this.dom.scroller=f("div."+l.sScrollBody,this.dom.grid.dt)[0];this._fnColCalc();this._fnGridSetup();var o;var n=false;f(this.s.dt.nTableWrapper).on("mousedown.DTFC",function(i){if(i.button===0){n=true;f(a).one("mouseup",function(){n=false})}});f(this.dom.scroller).on("mouseover.DTFC touchstart.DTFC",function(){if(!n){o="main"}}).on("scroll.DTFC",function(i){if(!o&&i.originalEvent){o="main"}if(o==="main"){if(p.s.iLeftColumns>0){p.dom.grid.left.liner.scrollTop=p.dom.scroller.scrollTop}if(p.s.iRightColumns>0){p.dom.grid.right.liner.scrollTop=p.dom.scroller.scrollTop}}});var k="onwheel" in a.createElement("div")?"wheel.DTFC":"mousewheel.DTFC";if(p.s.iLeftColumns>0){f(p.dom.grid.left.liner).on("mouseover.DTFC touchstart.DTFC",function(){if(!n){o="left"}}).on("scroll.DTFC",function(i){if(!o&&i.originalEvent){o="left"}if(o==="left"){p.dom.scroller.scrollTop=p.dom.grid.left.liner.scrollTop;if(p.s.iRightColumns>0){p.dom.grid.right.liner.scrollTop=p.dom.grid.left.liner.scrollTop}}}).on(k,function(t){var i=t.type==="wheel"?-t.originalEvent.deltaX:t.originalEvent.wheelDeltaX;p.dom.scroller.scrollLeft-=i})}if(p.s.iRightColumns>0){f(p.dom.grid.right.liner).on("mouseover.DTFC touchstart.DTFC",function(){if(!n){o="right"}}).on("scroll.DTFC",function(i){if(!o&&i.originalEvent){o="right"}if(o==="right"){p.dom.scroller.scrollTop=p.dom.grid.right.liner.scrollTop;if(p.s.iLeftColumns>0){p.dom.grid.left.liner.scrollTop=p.dom.grid.right.liner.scrollTop}}}).on(k,function(t){var i=t.type==="wheel"?-t.originalEvent.deltaX:t.originalEvent.wheelDeltaX;p.dom.scroller.scrollLeft-=i})}f(d).on("resize.DTFC",function(){p._fnGridLayout.call(p)});var s=true;var r=f(this.s.dt.nTable);r.on("draw.dt.DTFC",function(){p._fnColCalc();p._fnDraw.call(p,s);s=false}).on("column-sizing.dt.DTFC",function(){p._fnColCalc();p._fnGridLayout(p)}).on("column-visibility.dt.DTFC",function(w,u,t,v,i){if(i===g||i){p._fnColCalc();p._fnGridLayout(p);p._fnDraw(true)}}).on("select.dt.DTFC deselect.dt.DTFC",function(v,u,t,i){if(v.namespace==="dt"){p._fnDraw(false)}}).on("destroy.dt.DTFC",function(){r.off(".DTFC");f(p.dom.scroller).off(".DTFC");f(d).off(".DTFC");f(p.s.dt.nTableWrapper).off(".DTFC");f(p.dom.grid.left.liner).off(".DTFC "+k);f(p.dom.grid.left.wrapper).remove();f(p.dom.grid.right.liner).off(".DTFC "+k);f(p.dom.grid.right.wrapper).remove()});this._fnGridLayout();this.s.dt.oInstance.fnDraw(false)},_fnColCalc:function(){var j=this;var i=0;var h=0;this.s.aiInnerWidths=[];this.s.aiOuterWidths=[];f.each(this.s.dt.aoColumns,function(m,l){var n=f(l.nTh);var k;if(!n.filter(":visible").length){j.s.aiInnerWidths.push(0);j.s.aiOuterWidths.push(0)}else{var o=n.outerWidth();if(j.s.aiOuterWidths.length===0){k=f(j.s.dt.nTable).css("border-left-width");o+=typeof k==="string"&&k.indexOf("px")===-1?1:parseInt(k,10)}if(j.s.aiOuterWidths.length===j.s.dt.aoColumns.length-1){k=f(j.s.dt.nTable).css("border-right-width");o+=typeof k==="string"&&k.indexOf("px")===-1?1:parseInt(k,10)}j.s.aiOuterWidths.push(o);j.s.aiInnerWidths.push(n.width());if(m
')[0];var k=j.childNodes[0];var i=j.childNodes[1];this.dom.grid.dt.parentNode.insertBefore(j,this.dom.grid.dt);j.appendChild(this.dom.grid.dt);this.dom.grid.wrapper=j;if(this.s.iLeftColumns>0){this.dom.grid.left.wrapper=k;this.dom.grid.left.head=k.childNodes[0];this.dom.grid.left.body=k.childNodes[1];this.dom.grid.left.liner=f("div.DTFC_LeftBodyLiner",j)[0];j.appendChild(k)}if(this.s.iRightColumns>0){this.dom.grid.right.wrapper=i;this.dom.grid.right.head=i.childNodes[0];this.dom.grid.right.body=i.childNodes[1];this.dom.grid.right.liner=f("div.DTFC_RightBodyLiner",j)[0];i.style.right=h.bar+"px";m=f("div.DTFC_RightHeadBlocker",j)[0];m.style.width=h.bar+"px";m.style.right=-h.bar+"px";this.dom.grid.right.headBlock=m;m=f("div.DTFC_RightFootBlocker",j)[0];m.style.width=h.bar+"px";m.style.right=-h.bar+"px";this.dom.grid.right.footBlock=m;j.appendChild(i)}if(this.s.dt.nTFoot){this.dom.footer=this.s.dt.nTFoot.parentNode;if(this.s.iLeftColumns>0){this.dom.grid.left.foot=k.childNodes[2]}if(this.s.iRightColumns>0){this.dom.grid.right.foot=i.childNodes[2]}}if(this.s.rtl){f("div.DTFC_RightHeadBlocker",j).css({left:-h.bar+"px",right:""})}},_fnGridLayout:function(){var n=this;var p=this.dom.grid;var k=f(p.wrapper).width();var m=this.s.dt.nTable.parentNode.offsetHeight;var l=this.s.dt.nTable.parentNode.parentNode.offsetHeight;var r=this._fnDTOverflow();var q=this.s.iLeftWidth;var j=this.s.iRightWidth;var o=f(this.dom.body).css("direction")==="rtl";var i;var h=function(t,s){if(!r.bar){t.style.width=(s+20)+"px";t.style.paddingRight="20px";t.style.boxSizing="border-box"}else{if(n._firefoxScrollError()){if(f(t).height()>34){t.style.width=(s+r.bar)+"px"}}else{t.style.width=(s+r.bar)+"px"}}};if(r.x){m-=r.bar}p.wrapper.style.height=l+"px";if(this.s.iLeftColumns>0){i=p.left.wrapper;i.style.width=q+"px";i.style.height="1px";if(o){i.style.left="";i.style.right=0}else{i.style.left=0;i.style.right=""}p.left.body.style.height=m+"px";if(p.left.foot){p.left.foot.style.top=(r.x?r.bar:0)+"px"}h(p.left.liner,q);p.left.liner.style.height=m+"px";p.left.liner.style.maxHeight=m+"px"}if(this.s.iRightColumns>0){i=p.right.wrapper;i.style.width=j+"px";i.style.height="1px";if(this.s.rtl){i.style.left=r.y?r.bar+"px":0;i.style.right=""}else{i.style.left="";i.style.right=r.y?r.bar+"px":0}p.right.body.style.height=m+"px";if(p.right.foot){p.right.foot.style.top=(r.x?r.bar:0)+"px"}h(p.right.liner,j);p.right.liner.style.height=m+"px";p.right.liner.style.maxHeight=m+"px";p.right.headBlock.style.display=r.y?"block":"none";p.right.footBlock.style.display=r.y?"block":"none"}},_fnDTOverflow:function(){var j=this.s.dt.nTable;var h=j.parentNode;var i={x:false,y:false,bar:this.s.dt.oScroll.iBarWidth};if(j.offsetWidth>h.clientWidth){i.x=true}if(j.offsetHeight>h.clientHeight){i.y=true}return i},_fnDraw:function(h){this._fnGridLayout();this._fnCloneLeft(h);this._fnCloneRight(h);if(this.s.fnDrawCallback!==null){this.s.fnDrawCallback.call(this,this.dom.clone.left,this.dom.clone.right)}f(this).trigger("draw.dtfc",{leftClone:this.dom.clone.left,rightClone:this.dom.clone.right})},_fnCloneRight:function(j){if(this.s.iRightColumns<=0){return}var l=this,h,m,k=[];for(h=this.s.iTableColumns-this.s.iRightColumns;hthead",z.header);r.empty();for(B=0,x=m.length;Bthead",z.header)[0]);for(B=0,x=m.length;Btbody>tr",p.dom.body).css("height","auto")}if(z.body!==null){f(z.body).remove();z.body=null}z.body=f(this.dom.body).clone(true)[0];z.body.className+=" DTFC_Cloned";z.body.style.paddingBottom=t.oScroll.iBarWidth+"px";z.body.style.marginBottom=(t.oScroll.iBarWidth*2)+"px";if(z.body.getAttribute("id")!==null){z.body.removeAttribute("id")}f(">thead>tr",z.body).empty();f(">tfoot",z.body).remove();var s=f("tbody",z.body)[0];f(s).empty();if(t.aiDisplay.length>0){var o=f(">thead>tr",z.body)[0];for(q=0;qtbody>tr",p.dom.body).each(function(J){var j=p.s.dt.oFeatures.bServerSide===false?p.s.dt.aiDisplay[p.s.dt._iDisplayStart+J]:J;var I=p.s.dt.aoData[j].anCells||f(this).children("td, th");var K=this.cloneNode(false);K.removeAttribute("id");K.setAttribute("data-dt-row",j);for(q=0;q0){u=f(I[C]).clone(true,true)[0];u.removeAttribute("id");u.setAttribute("data-dt-row",j);u.setAttribute("data-dt-column",C);K.appendChild(u)}}s.appendChild(K)})}else{f(">tbody>tr",p.dom.body).each(function(i){u=this.cloneNode(true);u.className+=" DTFC_NoData";f("td",u).html("");s.appendChild(u)})}z.body.style.width="100%";z.body.style.margin="0";z.body.style.padding="0";if(t.oScroller!==g){var H=t.oScroller.dom.force;if(!y.forcer){y.forcer=H.cloneNode(true);y.liner.appendChild(y.forcer)}else{y.forcer.style.height=H.style.height}}y.liner.appendChild(z.body);this._fnEqualiseHeights("tbody",p.dom.body,z.body);if(t.nTFoot!==null){if(h){if(z.footer!==null){z.footer.parentNode.removeChild(z.footer)}z.footer=f(this.dom.footer).clone(true,true)[0];z.footer.className+=" DTFC_Cloned";z.footer.style.width="100%";y.foot.appendChild(z.footer);m=this._fnCopyLayout(t.aoFooter,l,true);var k=f(">tfoot",z.footer);k.empty();for(B=0,x=m.length;Btfoot",z.footer)[0]);for(B=0,x=m.length;Bthead",z.header)[0]);f(E).each(function(j){C=l[j];this.style.width=p.s.aiInnerWidths[C]+"px"});if(p.s.dt.nTFoot!==null){E=t.oApi._fnGetUniqueThs(t,f(">tfoot",z.footer)[0]);f(E).each(function(j){C=l[j];this.style.width=p.s.aiInnerWidths[C]+"px"})}},_fnGetTrNodes:function(j){var l=[];for(var k=0,h=j.childNodes.length;k"+u+">tr:eq(0)",j).children(":first"),w=l.outerHeight()-l.height(),o=this._fnGetTrNodes(p),v=this._fnGetTrNodes(r),s=[];for(n=0,k=v.length;ny?x:y;if(this.s.sHeightMatch=="semiauto"){o[n]._DTTC_iHeight=h}s.push(h)}for(n=0,k=v.length;n").css({position:"absolute",top:0,left:0,height:10,width:50,overflow:"scroll"}).appendTo("body");b=(h[0].clientWidth===h[0].offsetWidth&&this._fnDTOverflow().bar!==0);h.remove()}return b}});c.defaults={iLeftColumns:1,iRightColumns:0,fnDrawCallback:null,sHeightMatch:"semiauto"};c.version="3.2.6";e.Api.register("fixedColumns()",function(){return this});e.Api.register("fixedColumns().update()",function(){return this.iterator("table",function(h){if(h._oFixedColumns){h._oFixedColumns.fnUpdate()}})});e.Api.register("fixedColumns().relayout()",function(){return this.iterator("table",function(h){if(h._oFixedColumns){h._oFixedColumns.fnRedrawLayout()}})});e.Api.register("rows().recalcHeight()",function(){return this.iterator("row",function(i,h){if(i._oFixedColumns){i._oFixedColumns.fnRecalculateHeight(this.row(h).node())}})});e.Api.register("fixedColumns().rowIndex()",function(h){h=f(h);return h.parents(".DTFC_Cloned").length?this.rows({page:"current"}).indexes()[h.index()]:this.row(h).index()});e.Api.register("fixedColumns().cellIndex()",function(h){h=f(h);if(h.parents(".DTFC_Cloned").length){var j=h.parent().index();var l=this.rows({page:"current"}).indexes()[j];var k;if(h.parents(".DTFC_LeftWrapper").length){k=h.index()}else{var i=this.columns().flatten().length;k=i-this.context[0]._oFixedColumns.s.iRightColumns+h.index()}return{row:l,column:this.column.index("toData",k),columnVisible:k}}else{return this.cell(h).index()}});f(a).on("init.dt.fixedColumns",function(k,h){if(k.namespace!=="dt"){return}var l=h.oInit.fixedColumns;var j=e.defaults.fixedColumns;if(l||j){var i=f.extend({},l,j);if(l!==false){new c(h,i)}}});f.fn.dataTable.FixedColumns=c;f.fn.DataTable.FixedColumns=c;return c}));



© 2015 - 2025 Weber Informatics LLC | Privacy Policy