In the following JSFiddle the action function does not fire whenever a button to select a column in the column visibility button is selected. Below is the code that I am using:
$(document).ready(function() {
var table = $('#example').DataTable( {
dom: 'B',
"buttons": [
{
extend: 'colvis',
postfixButtons: ['colvisRestore'],
buttons : [{
extend: 'columnsToggle',
action: function (e, dt, node, config) {
alert('Activated!');
console.log("Activated!");
},
}],
}
],
}
);} );
I would really appreciate your help on this one.