Perform operation when column visibility changes with DTOptionsBuilder, ColVis using AngularJs

Perform operation when column visibility changes with DTOptionsBuilder, ColVis using AngularJs

shitalshital Posts: 0Questions: 3Answers: 0

This is legacy so it uses ColVis.
I am using DTOptionsBuilder with ColVis plugin for datatable+ show and hide columns in AngularJs. I want to perform some operations upon change in visibility of the columns. I found an event 'column-visibility.dt' which notifies columns visibility is changed. So I want to do something like below in Angular way but puzzled how?

$('#example').dataTable();
$('#example').on( 'column-visibility.dt', function ( e, settings, column, state ) { console.log( 'Column '+ column +' has changed to '+ (state ? 'visible' : 'hidden') ); } );

This discussion has been closed.