mirror of
https://github.com/DataTables/DataTables.git
synced 2025-01-18 11:52:11 +01:00
New: Pass the recalculation parameter through to the dt-event column-visibility
event allowing listeners to optimise for it
This commit is contained in:
parent
e8fc79f858
commit
3b867f209c
@ -1 +1 @@
|
||||
af2610be0a9525494d934559e345961d5941efce
|
||||
2734bacd0170da7a87e5b0cb21f9081c9738ff67
|
||||
|
2
media/js/jquery.dataTables.js
vendored
2
media/js/jquery.dataTables.js
vendored
@ -8384,7 +8384,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
_fnCallbackFire( settings, null, 'column-visibility', [settings, column, vis] );
|
||||
_fnCallbackFire( settings, null, 'column-visibility', [settings, column, vis, recalc] );
|
||||
|
||||
_fnSaveState( settings );
|
||||
};
|
||||
|
2
media/js/jquery.dataTables.min.js
vendored
2
media/js/jquery.dataTables.min.js
vendored
@ -120,7 +120,7 @@ a)bb(this);else if(c.length&&this.length){var d=c[0],c=c[0].aoData[this[0]],e=[]
|
||||
return[k[k.length+b]]}return[$(c,b)];case "name":return g.map(i,function(a,b){return a===l[1]?b:null})}else return g(j).filter(a).map(function(){return g.inArray(this,j)}).toArray()},c,f)},1);c.selector.cols=a;c.selector.opts=b;return c});u("columns().header()","column().header()",function(){return this.iterator("column",function(a,b){return a.aoColumns[b].nTh},1)});u("columns().footer()","column().footer()",function(){return this.iterator("column",function(a,b){return a.aoColumns[b].nTf},1)});u("columns().data()",
|
||||
"column().data()",function(){return this.iterator("column-rows",Vb,1)});u("columns().dataSrc()","column().dataSrc()",function(){return this.iterator("column",function(a,b){return a.aoColumns[b].mData},1)});u("columns().cache()","column().cache()",function(a){return this.iterator("column-rows",function(b,c,d,e,f){return ja(b.aoData,f,"search"===a?"_aFilterData":"_aSortData",c)},1)});u("columns().nodes()","column().nodes()",function(){return this.iterator("column-rows",function(a,b,c,d,e){return ja(a.aoData,
|
||||
e,"anCells",b)},1)});u("columns().visible()","column().visible()",function(a,b){return this.iterator("column",function(c,d){if(a===l)return c.aoColumns[d].bVisible;var e=c.aoColumns,f=e[d],h=c.aoData,i,j,k;if(a!==l&&f.bVisible!==a){if(a){var m=g.inArray(!0,D(e,"bVisible"),d+1);i=0;for(j=h.length;i<j;i++)k=h[i].nTr,e=h[i].anCells,k&&k.insertBefore(e[d],e[m]||null)}else g(D(c.aoData,"anCells",d)).detach();f.bVisible=a;ga(c,c.aoHeader);ga(c,c.aoFooter);if(b===l||b)Y(c),(c.oScroll.sX||c.oScroll.sY)&&
|
||||
Z(c);w(c,null,"column-visibility",[c,d,a]);ya(c)}})});u("columns().indexes()","column().index()",function(a){return this.iterator("column",function(b,c){return"visible"===a?ba(b,c):c},1)});p("columns.adjust()",function(){return this.iterator("table",function(a){Y(a)},1)});p("column.index()",function(a,b){if(0!==this.context.length){var c=this.context[0];if("fromVisible"===a||"toData"===a)return $(c,b);if("fromData"===a||"toVisible"===a)return ba(c,b)}});p("column()",function(a,b){return ab(this.columns(a,
|
||||
Z(c);w(c,null,"column-visibility",[c,d,a,b]);ya(c)}})});u("columns().indexes()","column().index()",function(a){return this.iterator("column",function(b,c){return"visible"===a?ba(b,c):c},1)});p("columns.adjust()",function(){return this.iterator("table",function(a){Y(a)},1)});p("column.index()",function(a,b){if(0!==this.context.length){var c=this.context[0];if("fromVisible"===a||"toData"===a)return $(c,b);if("fromData"===a||"toVisible"===a)return ba(c,b)}});p("column()",function(a,b){return ab(this.columns(a,
|
||||
b))});p("cells()",function(a,b,c){g.isPlainObject(a)&&(a.row===l?(c=a,a=null):(c=b,b=null));g.isPlainObject(b)&&(c=b,b=null);if(null===b||b===l)return this.iterator("table",function(b){var d=a,e=$a(c),f=b.aoData,h=Da(b,e),i=Rb(ja(f,h,"anCells")),j=g([].concat.apply([],i)),k,m=b.aoColumns.length,n,p,s,u,t,v;return Za("cell",d,function(a){var c=typeof a==="function";if(a===null||a===l||c){n=[];p=0;for(s=h.length;p<s;p++){k=h[p];for(u=0;u<m;u++){t={row:k,column:u};if(c){v=f[k];a(t,B(b,k,u),v.anCells?
|
||||
v.anCells[u]:null)&&n.push(t)}else n.push(t)}}return n}return g.isPlainObject(a)?[a]:j.filter(a).map(function(a,b){if(b.parentNode)k=b.parentNode._DT_RowIndex;else{a=0;for(s=f.length;a<s;a++)if(g.inArray(b,f[a].anCells)!==-1){k=a;break}}return{row:k,column:g.inArray(b,f[k].anCells)}}).toArray()},b,e)});var d=this.columns(b,c),e=this.rows(a,c),f,h,i,j,k,m=this.iterator("table",function(a,b){f=[];h=0;for(i=e[b].length;h<i;h++){j=0;for(k=d[b].length;j<k;j++)f.push({row:e[b][h],column:d[b][j]})}return f},
|
||||
1);g.extend(m.selector,{cols:b,rows:a,opts:c});return m});u("cells().nodes()","cell().node()",function(){return this.iterator("cell",function(a,b,c){return(a=a.aoData[b].anCells)?a[c]:l},1)});p("cells().data()",function(){return this.iterator("cell",function(a,b,c){return B(a,b,c)},1)});u("cells().cache()","cell().cache()",function(a){a="search"===a?"_aFilterData":"_aSortData";return this.iterator("cell",function(b,c,d){return b.aoData[c][a][d]},1)});u("cells().render()","cell().render()",function(a){return this.iterator("cell",
|
||||
|
Loading…
x
Reference in New Issue
Block a user