org.wicketstuff.datatables.media.js.ColVis.min.js Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of wicketstuff-datatables Show documentation
Show all versions of wicketstuff-datatables Show documentation
DataTables jQuery integration for Wicket
/*
* File: ColVis.min.js
* Version: 1.0.3
* Author: Allan Jardine (www.sprymedia.co.uk)
*
* Copyright 2010 Allan Jardine, all rights reserved.
*
* This source file is free software, under either the GPL v2 license or a
* BSD (3 point) style license, as supplied with this software.
*
* 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.
*/
(function(c){ColVis=function(a){if(!this.CLASS||this.CLASS!="ColVis")alert("Warning: ColVis must be initialised with the keyword 'new'");this.s={dt:null,activate:"click",buttonText:"Show / hide columns",hidden:true,aiExclude:[]};this.dom={wrapper:null,button:null,collection:null,background:null,catcher:null,buttons:[]};this.s.dt=a;this._fnConstruct();return this};ColVis.prototype={fnRebuild:function(){for(var a=this.dom.buttons.length-1;a>=0;a--)this.dom.collection.removeChild(this.dom.buttons[a]);
this.dom.buttons.splice(0,this.dom.buttons.length);this._fnAddButtons();this._fnDrawCallback()},_fnConstruct:function(){this._fnApplyCustomisation();var a=this;this.dom.wrapper=document.createElement("div");this.dom.wrapper.className="ColVis TableTools";this.dom.button=this._fnDomBaseButton(this.s.buttonText);this.dom.wrapper.appendChild(this.dom.button);this.dom.catcher=this._fnDomCatcher();this.dom.collection=this._fnDomCollection();this.dom.background=this._fnDomBackground();this._fnAddButtons();
this.s.dt.aoDrawCallback.push({fn:function(){a._fnDrawCallback.call(a)},sName:"ColVis"})},_fnApplyCustomisation:function(){if(typeof this.s.dt.oInit.oColVis!="undefined"){var a=this.s.dt.oInit.oColVis;if(typeof a.activate!="undefined")this.s.activate=a.activate;if(typeof a.buttonText!="undefined")this.s.buttonText=a.buttonText;if(typeof a.aiExclude!="undefined")this.s.aiExclude=a.aiExclude}},_fnDrawCallback:function(){for(var a=this.s.dt.aoColumns,b=0,d=a.length;b'+d.sTitle+"");c(e).click(function(g){var f=c("input",this).attr("checked")===true?false:true;if(g.target.nodeName.toLowerCase()=="input")f=c("input",this).attr("checked");g=c.fn.dataTableExt.iApiIndex;c.fn.dataTableExt.iApiIndex=b._fnDataTablesApiIndex.call(b);
b.s.dt.oInstance.fnSetColumnVis(a,f);c.fn.dataTableExt.iApiIndex=g});return e},_fnDataTablesApiIndex:function(){for(var a=0,b=this.s.dt.oInstance.length;aj?f:j)+"px";e.style.width=(ki)d.style.left=i-b+"px";if(g+f>j)d.style.top=g-f-c(this.dom.button).outerHeight()+"px";setTimeout(function(){c(d).animate({opacity:1},500);c(e).animate({opacity:0.1},500,"linear",function(){jQuery.browser.msie&&jQuery.browser.version=="6.0"&&a._fnDrawCallback()})},10);this.s.hidden=false},_fnCollectionHide:function(){var a=
this;if(!this.s.hidden&&this.dom.collection!==null){this.s.hidden=true;c(this.dom.collection).animate({opacity:0},500,function(){this.style.display="none"});c(this.dom.background).animate({opacity:0},500,function(){document.body.removeChild(a.dom.background);document.body.removeChild(a.dom.catcher)})}}};ColVis.fnRebuild=function(a){var b=null;if(typeof a!="undefined")b=a.fnSettings().nTable;for(var d=0,e=ColVis.aInstances.length;d
© 2015 - 2025 Weber Informatics LLC | Privacy Policy