mirror of
https://github.com/DataTables/DataTables.git
synced 2025-01-30 23:52:11 +01:00
Wrong variable passed to callbacks
This commit is contained in:
parent
3cbfbfe0fc
commit
5ccbb849a7
@ -1 +1 @@
|
||||
dbc18cabe53bc20369e24e30d2d1c151f68b6190
|
||||
5de12df3799542e2955ce47eda9b654b913bc36d
|
||||
|
8
media/js/jquery.dataTables.js
vendored
8
media/js/jquery.dataTables.js
vendored
@ -6311,7 +6311,7 @@
|
||||
|
||||
// Allow custom and plug-in manipulation functions to alter the saved data set and
|
||||
// cancelling of loading by returning false
|
||||
var abStateLoad = _fnCallbackFire( settings, 'aoStateLoadParams', 'stateLoadParams', [settings, state] );
|
||||
var abStateLoad = _fnCallbackFire( settings, 'aoStateLoadParams', 'stateLoadParams', [settings, s] );
|
||||
if ( $.inArray( false, abStateLoad ) !== -1 ) {
|
||||
callback();
|
||||
return;
|
||||
@ -6331,7 +6331,7 @@
|
||||
}
|
||||
|
||||
// Store the saved state so it might be accessed at any time
|
||||
settings.oLoadedState = $.extend( true, {}, state );
|
||||
settings.oLoadedState = $.extend( true, {}, s );
|
||||
|
||||
// Restore key features - todo - for 1.11 this needs to be done by
|
||||
// subscribed events
|
||||
@ -6360,7 +6360,7 @@
|
||||
}
|
||||
|
||||
// Columns
|
||||
//
|
||||
//
|
||||
if ( s.columns ) {
|
||||
for ( i=0, ien=s.columns.length ; i<ien ; i++ ) {
|
||||
var col = s.columns[i];
|
||||
@ -6377,7 +6377,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
_fnCallbackFire( settings, 'aoStateLoaded', 'stateLoaded', [settings, state] );
|
||||
_fnCallbackFire( settings, 'aoStateLoaded', 'stateLoaded', [settings, s] );
|
||||
callback();
|
||||
}
|
||||
|
||||
|
16
media/js/jquery.dataTables.min.js
vendored
16
media/js/jquery.dataTables.min.js
vendored
@ -70,20 +70,20 @@ k=a.nScrollBody,n=f(k),v=k.style,u=f(a.nScrollFoot).children("div"),q=u.children
|
||||
y&&(C=y.clone().prependTo(r),S=y.find("tr"),C=C.find("tr")),E=t.clone().prependTo(r),t=t.find("tr"),z=E.find("tr"),E.find("th, td").removeAttr("tabindex"),c||(v.width="100%",h[0].style.width="100%"),f.each(ta(a,E),function(b,c){J=aa(a,b);c.style.width=a.aoColumns[J].sWidth}),y&&N(function(a){a.style.width=""},C),h=r.outerWidth(),""===c?(x.width="100%",A&&(r.find("tbody").height()>k.offsetHeight||"scroll"==n.css("overflow-y"))&&(x.width=D(r.outerWidth()-b)),h=r.outerWidth()):""!==d&&(x.width=D(d),
|
||||
h=r.outerWidth()),N(K,z),N(function(a){H.push(a.innerHTML);F.push(D(f(a).css("width")))},z),N(function(a,b){-1!==f.inArray(a,Yb)&&(a.style.width=F[b])},t),f(z).height(0),y&&(N(K,C),N(function(a){I.push(a.innerHTML);G.push(D(f(a).css("width")))},C),N(function(a,b){a.style.width=G[b]},S),f(C).height(0)),N(function(a,b){a.innerHTML='<div class="dataTables_sizing" style="height:0;overflow:hidden;">'+H[b]+"</div>";a.style.width=F[b]},z),y&&N(function(a,b){a.innerHTML='<div class="dataTables_sizing" style="height:0;overflow:hidden;">'+
|
||||
I[b]+"</div>";a.style.width=G[b]},C),r.outerWidth()<h?(S=k.scrollHeight>k.offsetHeight||"scroll"==n.css("overflow-y")?h+b:h,A&&(k.scrollHeight>k.offsetHeight||"scroll"==n.css("overflow-y"))&&(x.width=D(S-b)),""!==c&&""===d||O(a,1,"Possible column misalignment",6)):S="100%",v.width=D(S),g.width=D(S),y&&(a.nScrollFoot.style.width=D(S)),!e&&A&&(v.height=D(w.offsetHeight+b)),c=r.outerWidth(),p[0].style.width=D(c),l.width=D(c),d=r.height()>k.clientHeight||"scroll"==n.css("overflow-y"),e="padding"+(B.bScrollbarLeft?
|
||||
"Left":"Right"),l[e]=d?b+"px":"0px",y&&(q[0].style.width=D(c),u[0].style.width=D(c),u[0].style[e]=d?b+"px":"0px"),r.children("colgroup").insertBefore(r.children("thead")),n.scroll(),!a.bSorted&&!a.bFiltered||a._drawHold||(k.scrollTop=0))}function N(a,b,c){for(var d=0,e=0,h=b.length,g,f;e<h;){g=b[e].firstChild;for(f=c?c[e].firstChild:null;g;)1===g.nodeType&&(c?a(g,f,d):a(g,d),d++),g=g.nextSibling,f=c?f.nextSibling:null;e++}}function Ga(a){var b=a.nTable,c=a.aoColumns,d=a.oScroll,e=d.sY,h=d.sX,g=d.sXInner,
|
||||
"Left":"Right"),l[e]=d?b+"px":"0px",y&&(q[0].style.width=D(c),u[0].style.width=D(c),u[0].style[e]=d?b+"px":"0px"),r.children("colgroup").insertBefore(r.children("thead")),n.scroll(),!a.bSorted&&!a.bFiltered||a._drawHold||(k.scrollTop=0))}function N(a,b,c){for(var d=0,e=0,h=b.length,g,k;e<h;){g=b[e].firstChild;for(k=c?c[e].firstChild:null;g;)1===g.nodeType&&(c?a(g,k,d):a(g,d),d++),g=g.nextSibling,k=c?k.nextSibling:null;e++}}function Ga(a){var b=a.nTable,c=a.aoColumns,d=a.oScroll,e=d.sY,h=d.sX,g=d.sXInner,
|
||||
k=c.length,l=na(a,"bVisible"),p=f("th",a.nTHead),n=b.getAttribute("width"),m=b.parentNode,u=!1,q,t,r=a.oBrowser,d=r.bScrollOversize;(q=b.style.width)&&-1!==q.indexOf("%")&&(n=q);for(q=0;q<l.length;q++)t=c[l[q]],null!==t.sWidth&&(t.sWidth=Eb(t.sWidthOrig,m),u=!0);if(d||!u&&!h&&!e&&k==ca(a)&&k==p.length)for(q=0;q<k;q++)l=aa(a,q),null!==l&&(c[l].sWidth=D(p.eq(q).width()));else{k=f(b).clone().css("visibility","hidden").removeAttr("id");k.find("tbody tr").remove();var w=f("<tr/>").appendTo(k.find("tbody"));
|
||||
k.find("thead, tfoot").remove();k.append(f(a.nTHead).clone()).append(f(a.nTFoot).clone());k.find("tfoot th, tfoot td").css("width","");p=ta(a,k.find("thead")[0]);for(q=0;q<l.length;q++)t=c[l[q]],p[q].style.width=null!==t.sWidthOrig&&""!==t.sWidthOrig?D(t.sWidthOrig):"",t.sWidthOrig&&h&&f(p[q]).append(f("<div/>").css({width:t.sWidthOrig,margin:0,padding:0,border:0,height:1}));if(a.aoData.length)for(q=0;q<l.length;q++)u=l[q],t=c[u],f(Fb(a,u)).clone(!1).append(t.sContentPadding).appendTo(w);f("[name]",
|
||||
k).removeAttr("name");t=f("<div/>").css(h||e?{position:"absolute",top:0,left:0,height:1,right:0,overflow:"hidden"}:{}).append(k).appendTo(m);h&&g?k.width(g):h?(k.css("width","auto"),k.removeAttr("width"),k.width()<m.clientWidth&&n&&k.width(m.clientWidth)):e?k.width(m.clientWidth):n&&k.width(n);for(q=e=0;q<l.length;q++)m=f(p[q]),g=m.outerWidth()-m.width(),m=r.bBounding?Math.ceil(p[q].getBoundingClientRect().width):m.outerWidth(),e+=m,c[l[q]].sWidth=D(m-g);b.style.width=D(e);t.remove()}n&&(b.style.width=
|
||||
D(n));!n&&!h||a._reszEvt||(b=function(){f(A).on("resize.DT-"+a.sInstance,Pa(function(){Z(a)}))},d?setTimeout(b,1E3):b(),a._reszEvt=!0)}function Eb(a,b){if(!a)return 0;var c=f("<div/>").css("width",D(a)).appendTo(b||x.body),d=c[0].offsetWidth;c.remove();return d}function Fb(a,b){var c=Gb(a,b);if(0>c)return null;var d=a.aoData[c];return d.nTr?d.anCells[b]:f("<td/>").html(I(a,c,b,"display"))[0]}function Gb(a,b){for(var c,d=-1,e=-1,h=0,g=a.aoData.length;h<g;h++)c=I(a,h,b,"display")+"",c=c.replace(Zb,
|
||||
""),c=c.replace(/ /g," "),c.length>d&&(d=c.length,e=h);return e}function D(a){return null===a?"0px":"number"==typeof a?0>a?"0px":a+"px":a.match(/\d$/)?a+"px":a}function X(a){var b,c,d=[],e=a.aoColumns,h,g,k,l;b=a.aaSortingFixed;c=f.isPlainObject(b);var p=[];h=function(a){a.length&&!f.isArray(a[0])?p.push(a):f.merge(p,a)};f.isArray(b)&&h(b);c&&b.pre&&h(b.pre);h(a.aaSorting);c&&b.post&&h(b.post);for(a=0;a<p.length;a++)for(l=p[a][0],h=e[l].aDataSort,b=0,c=h.length;b<c;b++)g=h[b],k=e[g].sType||"string",
|
||||
p[a]._idx===m&&(p[a]._idx=f.inArray(p[a][1],e[g].asSorting)),d.push({src:l,col:g,dir:p[a][1],index:p[a]._idx,type:k,formatter:q.ext.type.order[k+"-pre"]});return d}function mb(a){var b,c,d=[],e=q.ext.type.order,h=a.aoData,g=0,f,l=a.aiDisplayMaster,p;Ha(a);p=X(a);b=0;for(c=p.length;b<c;b++)f=p[b],f.formatter&&g++,Hb(a,f.col);if("ssp"!=F(a)&&0!==p.length){b=0;for(c=l.length;b<c;b++)d[l[b]]=b;g===p.length?l.sort(function(a,b){var c,e,g,f,k=p.length,l=h[a]._aSortData,n=h[b]._aSortData;for(g=0;g<k;g++)if(f=
|
||||
p[g],c=l[f.col],e=n[f.col],c=c<e?-1:c>e?1:0,0!==c)return"asc"===f.dir?c:-c;c=d[a];e=d[b];return c<e?-1:c>e?1:0}):l.sort(function(a,b){var c,g,f,k,l=p.length,n=h[a]._aSortData,m=h[b]._aSortData;for(f=0;f<l;f++)if(k=p[f],c=n[k.col],g=m[k.col],k=e[k.type+"-"+k.dir]||e["string-"+k.dir],c=k(c,g),0!==c)return c;c=d[a];g=d[b];return c<g?-1:c>g?1:0})}a.bSorted=!0}function Ib(a){var b,c,d=a.aoColumns,e=X(a);a=a.oLanguage.oAria;for(var h=0,g=d.length;h<g;h++){c=d[h];var f=c.asSorting;b=c.sTitle.replace(/<.*?>/g,
|
||||
p[a]._idx===m&&(p[a]._idx=f.inArray(p[a][1],e[g].asSorting)),d.push({src:l,col:g,dir:p[a][1],index:p[a]._idx,type:k,formatter:q.ext.type.order[k+"-pre"]});return d}function mb(a){var b,c,d=[],e=q.ext.type.order,h=a.aoData,g=0,k,f=a.aiDisplayMaster,p;Ha(a);p=X(a);b=0;for(c=p.length;b<c;b++)k=p[b],k.formatter&&g++,Hb(a,k.col);if("ssp"!=F(a)&&0!==p.length){b=0;for(c=f.length;b<c;b++)d[f[b]]=b;g===p.length?f.sort(function(a,b){var c,e,g,f,k=p.length,l=h[a]._aSortData,n=h[b]._aSortData;for(g=0;g<k;g++)if(f=
|
||||
p[g],c=l[f.col],e=n[f.col],c=c<e?-1:c>e?1:0,0!==c)return"asc"===f.dir?c:-c;c=d[a];e=d[b];return c<e?-1:c>e?1:0}):f.sort(function(a,b){var c,g,f,k,l=p.length,n=h[a]._aSortData,m=h[b]._aSortData;for(f=0;f<l;f++)if(k=p[f],c=n[k.col],g=m[k.col],k=e[k.type+"-"+k.dir]||e["string-"+k.dir],c=k(c,g),0!==c)return c;c=d[a];g=d[b];return c<g?-1:c>g?1:0})}a.bSorted=!0}function Ib(a){var b,c,d=a.aoColumns,e=X(a);a=a.oLanguage.oAria;for(var h=0,g=d.length;h<g;h++){c=d[h];var f=c.asSorting;b=c.sTitle.replace(/<.*?>/g,
|
||||
"");var l=c.nTh;l.removeAttribute("aria-sort");c.bSortable&&(0<e.length&&e[0].col==h?(l.setAttribute("aria-sort","asc"==e[0].dir?"ascending":"descending"),c=f[e[0].index+1]||f[0]):c=f[0],b+="asc"===c?a.sSortAscending:a.sSortDescending);l.setAttribute("aria-label",b)}}function Va(a,b,c,d){var e=a.aaSorting,h=a.aoColumns[b].asSorting,g=function(a,b){var c=a._idx;c===m&&(c=f.inArray(a[1],h));return c+1<h.length?c+1:b?null:0};"number"===typeof e[0]&&(e=a.aaSorting=[e]);c&&a.oFeatures.bSortMulti?(c=f.inArray(b,
|
||||
L(e,"0")),-1!==c?(b=g(e[c],!0),null===b&&1===e.length&&(b=0),null===b?e.splice(c,1):(e[c][1]=h[b],e[c]._idx=b)):(e.push([b,h[0],0]),e[e.length-1]._idx=0)):e.length&&e[0][0]==b?(b=g(e[0]),e.length=1,e[0][1]=h[b],e[0]._idx=b):(e.length=0,e.push([b,h[0]]),e[0]._idx=0);V(a);"function"==typeof d&&d(a)}function Na(a,b,c,d){var e=a.aoColumns[c];Wa(b,{},function(b){!1!==e.bSortable&&(a.oFeatures.bProcessing?(J(a,!0),setTimeout(function(){Va(a,c,b.shiftKey,d);"ssp"!==F(a)&&J(a,!1)},0)):Va(a,c,b.shiftKey,d))})}
|
||||
function ya(a){var b=a.aLastSort,c=a.oClasses.sSortColumn,d=X(a),e=a.oFeatures,h,g;if(e.bSort&&e.bSortClasses){e=0;for(h=b.length;e<h;e++)g=b[e].src,f(L(a.aoData,"anCells",g)).removeClass(c+(2>e?e+1:3));e=0;for(h=d.length;e<h;e++)g=d[e].src,f(L(a.aoData,"anCells",g)).addClass(c+(2>e?e+1:3))}a.aLastSort=d}function Hb(a,b){var c=a.aoColumns[b],d=q.ext.order[c.sSortDataType],e;d&&(e=d.call(a.oInstance,a,b,ba(a,b)));for(var h,g=q.ext.type.order[c.sType+"-pre"],f=0,l=a.aoData.length;f<l;f++)if(c=a.aoData[f],
|
||||
c._aSortData||(c._aSortData=[]),!c._aSortData[b]||d)h=d?e[f]:I(a,f,b,"sort"),c._aSortData[b]=g?g(h):h}function za(a){if(a.oFeatures.bStateSave&&!a.bDestroying){var b={time:+new Date,start:a._iDisplayStart,length:a._iDisplayLength,order:f.extend(!0,[],a.aaSorting),search:Ab(a.oPreviousSearch),columns:f.map(a.aoColumns,function(b,d){return{visible:b.bVisible,search:Ab(a.aoPreSearchCols[d])}})};y(a,"aoStateSaveParams","stateSaveParams",[a,b]);a.oSavedState=b;a.fnStateSaveCallback.call(a.oInstance,a,
|
||||
b)}}function Jb(a,b,c){var d,e,h=a.aoColumns;b=function(b){if(b&&b.time){var k=y(a,"aoStateLoadParams","stateLoadParams",[a,g]);if(-1===f.inArray(!1,k)&&(k=a.iStateDuration,!(0<k&&b.time<+new Date-1E3*k||b.columns&&h.length!==b.columns.length))){a.oLoadedState=f.extend(!0,{},g);b.start!==m&&(a._iDisplayStart=b.start,a.iInitDisplayStart=b.start);b.length!==m&&(a._iDisplayLength=b.length);b.order!==m&&(a.aaSorting=[],f.each(b.order,function(b,c){a.aaSorting.push(c[0]>=h.length?[0,c[1]]:c)}));b.search!==
|
||||
m&&f.extend(a.oPreviousSearch,Bb(b.search));if(b.columns)for(d=0,e=b.columns.length;d<e;d++)k=b.columns[d],k.visible!==m&&(h[d].bVisible=k.visible),k.search!==m&&f.extend(a.aoPreSearchCols[d],Bb(k.search));y(a,"aoStateLoaded","stateLoaded",[a,g])}}c()};if(a.oFeatures.bStateSave){var g=a.fnStateLoadCallback.call(a.oInstance,a,b);g!==m&&b(g)}else c()}function Aa(a){var b=q.settings;a=f.inArray(a,L(b,"nTable"));return-1!==a?b[a]:null}function O(a,b,c,d){c="DataTables warning: "+(a?"table id="+a.sTableId+
|
||||
b)}}function Jb(a,b,c){var d,e,h=a.aoColumns;b=function(b){if(b&&b.time){var g=y(a,"aoStateLoadParams","stateLoadParams",[a,b]);if(-1===f.inArray(!1,g)&&(g=a.iStateDuration,!(0<g&&b.time<+new Date-1E3*g||b.columns&&h.length!==b.columns.length))){a.oLoadedState=f.extend(!0,{},b);b.start!==m&&(a._iDisplayStart=b.start,a.iInitDisplayStart=b.start);b.length!==m&&(a._iDisplayLength=b.length);b.order!==m&&(a.aaSorting=[],f.each(b.order,function(b,c){a.aaSorting.push(c[0]>=h.length?[0,c[1]]:c)}));b.search!==
|
||||
m&&f.extend(a.oPreviousSearch,Bb(b.search));if(b.columns)for(d=0,e=b.columns.length;d<e;d++)g=b.columns[d],g.visible!==m&&(h[d].bVisible=g.visible),g.search!==m&&f.extend(a.aoPreSearchCols[d],Bb(g.search));y(a,"aoStateLoaded","stateLoaded",[a,b])}}c()};if(a.oFeatures.bStateSave){var g=a.fnStateLoadCallback.call(a.oInstance,a,b);g!==m&&b(g)}else c()}function Aa(a){var b=q.settings;a=f.inArray(a,L(b,"nTable"));return-1!==a?b[a]:null}function O(a,b,c,d){c="DataTables warning: "+(a?"table id="+a.sTableId+
|
||||
" - ":"")+c;d&&(c+=". For more information about this error, please see http://datatables.net/tn/"+d);if(b)A.console&&console.log&&console.log(c);else if(b=q.ext,b=b.sErrMode||b.errMode,a&&y(a,null,"error",[a,d,c]),"alert"==b)alert(c);else{if("throw"==b)throw Error(c);"function"==typeof b&&b(a,d,c)}}function M(a,b,c,d){f.isArray(c)?f.each(c,function(c,d){f.isArray(d)?M(a,b,d[0],d[1]):M(a,b,d)}):(d===m&&(d=c),b[c]!==m&&(a[d]=b[c]))}function Kb(a,b,c){var d,e;for(e in b)b.hasOwnProperty(e)&&(d=b[e],
|
||||
f.isPlainObject(d)?(f.isPlainObject(a[e])||(a[e]={}),f.extend(!0,a[e],d)):c&&"data"!==e&&"aaData"!==e&&f.isArray(d)?a[e]=d.slice():a[e]=d);return a}function Wa(a,b,c){f(a).on("click.DT",b,function(b){a.blur();c(b)}).on("keypress.DT",b,function(a){13===a.which&&(a.preventDefault(),c(a))}).on("selectstart.DT",function(){return!1})}function G(a,b,c,d){c&&a[b].push({fn:c,sName:d})}function y(a,b,c,d){var e=[];b&&(e=f.map(a[b].slice().reverse(),function(b,c){return b.fn.apply(a.oInstance,d)}));null!==
|
||||
c&&(b=f.Event(c+".dt"),f(a.nTable).trigger(b,d),e.push(b.result));return e}function Ta(a){var b=a._iDisplayStart,c=a.fnDisplayEnd(),d=a._iDisplayLength;b>=c&&(b=c-d);b-=b%d;if(-1===d||0>b)b=0;a._iDisplayStart=b}function Oa(a,b){var c=a.renderer,d=q.ext.renderer[b];return f.isPlainObject(c)&&c[b]?d[c[b]]||d._:"string"===typeof c?d[c]||d._:d._}function F(a){return a.oFeatures.bServerSide?"ssp":a.ajax||a.sAjaxSource?"ajax":"dom"}function ja(a,b){var c;c=Lb.numbers_length;var d=Math.floor(c/2);b<=c?c=
|
||||
@ -129,12 +129,12 @@ c,d){var e=b.aoData,h=e[c],g,f,l,p,n;e.splice(c,1);g=0;for(f=e.length;g<f;g++)if
|
||||
a.length;d<g;d++)c=a[d],c.nodeName&&"TR"===c.nodeName.toUpperCase()?f.push(oa(b,c)[0]):f.push(Q(b,c));return f},1),c=this.rows(-1);c.pop();f.merge(c,b);return c});t("row()",function(a,b){return bb(this.rows(a,b))});t("row().data()",function(a){var b=this.context;if(a===m)return b.length&&this.length?b[0].aoData[this[0]]._aData:m;b[0].aoData[this[0]]._aData=a;ea(b[0],this[0],"data");return this});t("row().node()",function(){var a=this.context;return a.length&&this.length?a[0].aoData[this[0]].nTr||
|
||||
null:null});t("row.add()",function(a){a instanceof f&&a.length&&(a=a[0]);var b=this.iterator("table",function(b){return a.nodeName&&"TR"===a.nodeName.toUpperCase()?oa(b,a)[0]:Q(b,a)});return this.row(b[0])});var ec=function(a,b,c,d){var e=[],h=function(b,c){if(f.isArray(b)||b instanceof f)for(var d=0,g=b.length;d<g;d++)h(b[d],c);else b.nodeName&&"tr"===b.nodeName.toLowerCase()?e.push(b):(d=f("<tr><td/></tr>").addClass(c),f("td",d).addClass(c).html(b)[0].colSpan=ca(a),e.push(d[0]))};h(c,d);b._details&&
|
||||
b._details.detach();b._details=f(e);b._detailsShow&&b._details.insertAfter(b.nTr)},cb=function(a,b){var c=a.context;c.length&&(c=c[0].aoData[b!==m?b:a[0]])&&c._details&&(c._details.remove(),c._detailsShow=m,c._details=m)},Ub=function(a,b){var c=a.context;if(c.length&&a.length){var d=c[0].aoData[a[0]];d._details&&((d._detailsShow=b)?d._details.insertAfter(d.nTr):d._details.detach(),fc(c[0]))}},fc=function(a){var b=new w(a),c=a.aoData;b.off("draw.dt.DT_details column-visibility.dt.DT_details destroy.dt.DT_details");
|
||||
0<L(c,"_details").length&&(b.on("draw.dt.DT_details",function(d,e){a===e&&b.rows({page:"current"}).eq(0).each(function(a){a=c[a];a._detailsShow&&a._details.insertAfter(a.nTr)})}),b.on("column-visibility.dt.DT_details",function(b,e,h,f){if(a===e)for(e=ca(e),h=0,f=c.length;h<f;h++)b=c[h],b._details&&b._details.children("td[colspan]").attr("colspan",e)}),b.on("destroy.dt.DT_details",function(d,e){if(a===e)for(var f=0,g=c.length;f<g;f++)c[f]._details&&cb(b,f)}))};t("row().child()",function(a,b){var c=
|
||||
0<L(c,"_details").length&&(b.on("draw.dt.DT_details",function(d,e){a===e&&b.rows({page:"current"}).eq(0).each(function(a){a=c[a];a._detailsShow&&a._details.insertAfter(a.nTr)})}),b.on("column-visibility.dt.DT_details",function(b,e,h,g){if(a===e)for(e=ca(e),h=0,g=c.length;h<g;h++)b=c[h],b._details&&b._details.children("td[colspan]").attr("colspan",e)}),b.on("destroy.dt.DT_details",function(d,e){if(a===e)for(var h=0,g=c.length;h<g;h++)c[h]._details&&cb(b,h)}))};t("row().child()",function(a,b){var c=
|
||||
this.context;if(a===m)return c.length&&this.length?c[0].aoData[this[0]]._details:m;!0===a?this.child.show():!1===a?cb(this):c.length&&this.length&&ec(c[0],c[0].aoData[this[0]],a,b);return this});t(["row().child.show()","row().child().show()"],function(a){Ub(this,!0);return this});t(["row().child.hide()","row().child().hide()"],function(){Ub(this,!1);return this});t(["row().child.remove()","row().child().remove()"],function(){cb(this);return this});t("row().child.isShown()",function(){var a=this.context;
|
||||
return a.length&&this.length?a[0].aoData[this[0]]._detailsShow||!1:!1});var gc=/^([^:]+):(name|visIdx|visible)$/,Vb=function(a,b,c,d,e){c=[];d=0;for(var f=e.length;d<f;d++)c.push(I(a,e[d],b));return c},hc=function(a,b,c){var d=a.aoColumns,e=L(d,"sName"),h=L(d,"nTh");return $a("column",b,function(b){var g=Ob(b);if(""===b)return Y(d.length);if(null!==g)return[0<=g?g:d.length+g];if("function"===typeof b){var l=Da(a,c);return f.map(d,function(c,d){return b(d,Vb(a,d,0,0,l),h[d])?d:null})}var m="string"===
|
||||
return a.length&&this.length?a[0].aoData[this[0]]._detailsShow||!1:!1});var gc=/^([^:]+):(name|visIdx|visible)$/,Vb=function(a,b,c,d,e){c=[];d=0;for(var h=e.length;d<h;d++)c.push(I(a,e[d],b));return c},hc=function(a,b,c){var d=a.aoColumns,e=L(d,"sName"),h=L(d,"nTh");return $a("column",b,function(b){var g=Ob(b);if(""===b)return Y(d.length);if(null!==g)return[0<=g?g:d.length+g];if("function"===typeof b){var l=Da(a,c);return f.map(d,function(c,d){return b(d,Vb(a,d,0,0,l),h[d])?d:null})}var m="string"===
|
||||
typeof b?b.match(gc):"";if(m)switch(m[2]){case "visIdx":case "visible":g=parseInt(m[1],10);if(0>g){var n=f.map(d,function(a,b){return a.bVisible?b:null});return[n[n.length+g]]}return[aa(a,g)];case "name":return f.map(e,function(a,b){return a===m[1]?b:null});default:return[]}if(b.nodeName&&b._DT_CellIndex)return[b._DT_CellIndex.column];g=f(h).filter(b).map(function(){return f.inArray(this,h)}).toArray();if(g.length||!b.nodeName)return g;g=f(b).closest("*[data-dt-column]");return g.length?[g.data("dt-column")]:
|
||||
[]},a,c)};t("columns()",function(a,b){a===m?a="":f.isPlainObject(a)&&(b=a,a="");b=ab(b);var c=this.iterator("table",function(c){return hc(c,a,b)},1);c.selector.cols=a;c.selector.opts=b;return c});B("columns().header()","column().header()",function(a,b){return this.iterator("column",function(a,b){return a.aoColumns[b].nTh},1)});B("columns().footer()","column().footer()",function(a,b){return this.iterator("column",function(a,b){return a.aoColumns[b].nTf},1)});B("columns().data()","column().data()",
|
||||
function(){return this.iterator("column-rows",Vb,1)});B("columns().dataSrc()","column().dataSrc()",function(){return this.iterator("column",function(a,b){return a.aoColumns[b].mData},1)});B("columns().cache()","column().cache()",function(a){return this.iterator("column-rows",function(b,c,d,e,f){return ka(b.aoData,f,"search"===a?"_aFilterData":"_aSortData",c)},1)});B("columns().nodes()","column().nodes()",function(){return this.iterator("column-rows",function(a,b,c,d,e){return ka(a.aoData,e,"anCells",
|
||||
function(){return this.iterator("column-rows",Vb,1)});B("columns().dataSrc()","column().dataSrc()",function(){return this.iterator("column",function(a,b){return a.aoColumns[b].mData},1)});B("columns().cache()","column().cache()",function(a){return this.iterator("column-rows",function(b,c,d,e,h){return ka(b.aoData,h,"search"===a?"_aFilterData":"_aSortData",c)},1)});B("columns().nodes()","column().nodes()",function(){return this.iterator("column-rows",function(a,b,c,d,e){return ka(a.aoData,e,"anCells",
|
||||
b)},1)});B("columns().visible()","column().visible()",function(a,b){var c=this.iterator("column",function(b,c){if(a===m)return b.aoColumns[c].bVisible;var d=b.aoColumns,e=d[c],k=b.aoData,l,p,n;if(a!==m&&e.bVisible!==a){if(a){var q=f.inArray(!0,L(d,"bVisible"),c+1);l=0;for(p=k.length;l<p;l++)n=k[l].nTr,d=k[l].anCells,n&&n.insertBefore(d[c],d[q]||null)}else f(L(b.aoData,"anCells",c)).detach();e.bVisible=a;ga(b,b.aoHeader);ga(b,b.aoFooter);za(b)}});a!==m&&(this.iterator("column",function(c,e){y(c,null,
|
||||
"column-visibility",[c,e,a,b])}),(b===m||b)&&this.columns.adjust());return c});B("columns().indexes()","column().index()",function(a){return this.iterator("column",function(b,c){return"visible"===a?ba(b,c):c},1)});t("columns.adjust()",function(){return this.iterator("table",function(a){Z(a)},1)});t("column.index()",function(a,b){if(0!==this.context.length){var c=this.context[0];if("fromVisible"===a||"toData"===a)return aa(c,b);if("fromData"===a||"toVisible"===a)return ba(c,b)}});t("column()",function(a,
|
||||
b){return bb(this.columns(a,b))});var ic=function(a,b,c){var d=a.aoData,e=Da(a,c),h=Rb(ka(d,e,"anCells")),g=f([].concat.apply([],h)),k,l=a.aoColumns.length,p,n,q,t,x,w;return $a("cell",b,function(b){var c="function"===typeof b;if(null===b||b===m||c){p=[];n=0;for(q=e.length;n<q;n++)for(k=e[n],t=0;t<l;t++)x={row:k,column:t},c?(w=d[k],b(x,I(a,k,t),w.anCells?w.anCells[t]:null)&&p.push(x)):p.push(x);return p}if(f.isPlainObject(b))return[b];c=g.filter(b).map(function(a,b){return{row:b._DT_CellIndex.row,
|
||||
|
Loading…
x
Reference in New Issue
Block a user