META-INF.resources.bower_components.datatables.net-buttons.js.buttons.colVis.min.js Maven / Gradle / Ivy
/*!
* Column visibility buttons for Buttons and DataTables.
* 2016 SpryMedia Ltd - datatables.net/license
*/
(function(a){if(typeof define==="function"&&define.amd){define(["jquery","datatables.net","datatables.net-buttons"],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).$}if(!c.fn.dataTable.Buttons){require("datatables.net-buttons")(b,c)}return a(c,b,b.document)}}else{a(jQuery,window,document)}}}(function(d,b,a,e){var c=d.fn.dataTable;d.extend(c.ext.buttons,{colvis:function(g,f){return{extend:"collection",text:function(h){return h.i18n("buttons.colvis","Column visibility")},className:"buttons-colvis",buttons:[{extend:"columnsToggle",columns:f.columns,columnText:f.columnText}]}},columnsToggle:function(h,f){var g=h.columns(f.columns).indexes().map(function(i){return{extend:"columnToggle",columns:i,columnText:f.columnText}}).toArray();return g},columnToggle:function(g,f){return{extend:"columnVisibility",columns:f.columns,columnText:f.columnText}},columnsVisibility:function(h,f){var g=h.columns(f.columns).indexes().map(function(i){return{extend:"columnVisibility",columns:i,visibility:f.visibility,columnText:f.columnText}}).toArray();return g},columnVisibility:{columns:e,text:function(h,g,f){return f._columnText(h,f)},className:"buttons-columnVisibility",action:function(k,i,h,g){var f=i.columns(g.columns);var j=f.visible();f.visible(g.visibility!==e?g.visibility:!(j.length?j[0]:false))},init:function(i,g,f){var h=this;i.on("column-visibility.dt"+f.namespace,function(k,j){if(!j.bDestroying&&j.nTable==i.settings()[0].nTable){h.active(i.column(f.columns).visible())}}).on("column-reorder.dt"+f.namespace,function(l,k,j){if(i.columns(f.columns).count()!==1){return}h.text(f._columnText(i,f));h.active(i.column(f.columns).visible())});this.active(i.column(f.columns).visible())},destroy:function(h,g,f){h.off("column-visibility.dt"+f.namespace).off("column-reorder.dt"+f.namespace)},_columnText:function(h,g){var f=h.column(g.columns).index();var i=h.settings()[0].aoColumns[f].sTitle.replace(/\n/g," ").replace(/
/gi," ").replace(/
© 2015 - 2025 Weber Informatics LLC | Privacy Policy