how to know if any columnToggle is active

how to know if any columnToggle is active

bilusesbiluses Posts: 26Questions: 10Answers: 0
edited April 2019 in Buttons

I have a button called "Filter", in his Action function i call a LOOP FOR to create as many sub-buttons as dynamic headers my DataTable have, Filter button show/hide that buttons when i click on them. Similar like Colvis do. That buttons Toggle the headers visibility for table columns that they represent.
**I would like to know if there is a way to know if any toggle is active, to change the Filter background color if any filter is active.
**


buttons: [ { text: '<i class="fas fa-filter fa-2x"></i> Filtrar', className: 'nobuttons_style filter_action', action: function ( e, dt, node, config ) { for(let u=0; u < buttonsArray.length; u++) { let textTransform = buttonsArray[u].toString(); let StrippedString = textTransform.replace(/(<([^>]+)>)/ig,""); dt.button().add(0, { text: StrippedString, extend: 'columnToggle', columns: '.'+StrippedString, className: 'searchButton special_toggle filter_toTop '+ StrippedString, background:false, attr: { id: 'toggleColumns' } }); } } },

This question has an accepted answers - jump to answer

Answers

This discussion has been closed.