org.wicketstuff.datatables.media.js.ColReorder.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: ColReorder.min.js
* Version: 1.0.0
* 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(f,n,i){function l(a){for(var c=[],d=0,b=a.length;d=g)this.oApi._fnLog(a,1,"ColReorder 'from' index is out of bounds: "+c);else if(d<0||d>=g)this.oApi._fnLog(a,1,"ColReorder 'to' index is out of bounds: "+d);else{var h=
[];b=0;for(e=g;bthis.s.fixed-1&&f(this.s.dt.aoColumns[c].nTh).bind("mousedown.ColReorder",function(g){a._fnMouseDown.call(a,g);return false});this.s.dt.aoColumns[c]._ColReorder_iOrigCol=c}this.s.dt.aoStateSave.push({fn:function(g,h){return a._fnStateSave.call(a,h)},sName:"ColReorder_State"});var b=null;if(typeof this.s.init.aiOrder!=
"undefined")b=this.s.init.aiOrder.slice();if(this.s.dt.oLoadedState&&typeof this.s.dt.oLoadedState.ColReorder!="undefined"&&this.s.dt.oLoadedState.ColReorder.length==this.s.dt.aoColumns.length)b=this.s.dt.oLoadedState.ColReorder;if(b)if(a.s.dt._bInitComplete){c=l(b);a._fnOrderColumns.call(a,c)}else{var e=false;this.s.dt.aoDrawCallback.push({fn:function(){if(!a.s.dt._bInitComplete&&!e){e=true;var g=l(b);a._fnOrderColumns.call(a,g)}},sName:"ColReorder_Pre"})}},_fnOrderColumns:function(a){if(a.length!=
this.s.dt.aoColumns.length)this.s.dt.oInstance.oApi._fnLog(oDTSettings,1,"ColReorder - array reorder does not match known number of columns. Skipping.");else{for(var c=0,d=a.length;c0;)this.dom.drag.removeChild(this.dom.drag.getElementsByTagName("tbody")[0]);
for(;this.dom.drag.getElementsByTagName("tfoot").length>0;)this.dom.drag.removeChild(this.dom.drag.getElementsByTagName("tfoot")[0]);f("thead tr:eq(0)",this.dom.drag).each(function(){f("th:not(:eq("+a.s.mouse.targetIndex+"))",this).remove()});f("tr",this.dom.drag).height(f(a.s.dt.nTHead).height());f("thead tr:gt(0)",this.dom.drag).remove();f("thead th:eq(0)",this.dom.drag).each(function(){this.style.width=f("th:eq("+a.s.mouse.targetIndex+")",a.s.dt.nTHead).width()+"px"});this.dom.drag.style.position=
"absolute";this.dom.drag.style.top="0px";this.dom.drag.style.left="0px";this.dom.drag.style.width=f("th:eq("+a.s.mouse.targetIndex+")",a.s.dt.nTHead).outerWidth()+"px";this.dom.pointer=i.createElement("div");this.dom.pointer.className="DTCR_pointer";this.dom.pointer.style.position="absolute";if(this.s.dt.oScroll.sX===""&&this.s.dt.oScroll.sY===""){this.dom.pointer.style.top=f(this.s.dt.nTable).offset().top+"px";this.dom.pointer.style.height=f(this.s.dt.nTable).height()+"px"}else{this.dom.pointer.style.top=
f("div.dataTables_scroll",this.s.dt.nTableWrapper).offset().top+"px";this.dom.pointer.style.height=f("div.dataTables_scroll",this.s.dt.nTableWrapper).height()+"px"}i.body.appendChild(this.dom.pointer);i.body.appendChild(this.dom.drag)}};ColReorder.aoInstances=[];ColReorder.fnReset=function(a){for(var c=0,d=ColReorder.aoInstances.length;c
© 2015 - 2025 Weber Informatics LLC | Privacy Policy