Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 81728

colvis with groups of columns

$
0
0

I'm trying to do column visibility with grouping. I currently have:

$(document).ready(function() {
        var table = $('#table1').DataTable( {
                fixedHeader: true,
                dom: 'Blftrip',
                buttons: [
                {       
                   columns: [1,2,3,4,5] ,
                   extend: 'colvis',
                   text: 'Toggle Column Sets',
                }
        ]
 } );
} );

When I press the "Toggle Column Sets" button, it currently gives me the option of toggling each of the columns 1-5 individually. I want it so that when I press "Toggle Column Sets", it instead gives my an option to toggle [1,2] or [3,4,5] as groups.

What's the easiest way to do this?
Thanks.


Viewing all articles
Browse latest Browse all 81728

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>