Buttons (with colvis) and responsive extensions integration

Buttons (with colvis) and responsive extensions integration

alesnavalesnav Posts: 19Questions: 5Answers: 1

Hello!

I have a problem integrating these both extensions.

When using class="never" for responsive, I think that it would be nice if colvis doesn't show that column as selectable.

You can see the example here. Column Age has class="never" applied and colvis shows that column as selectable in its menu, but of course it is not shown anyway.

What do you think about this?

Thanks!!

This question has an accepted answers - jump to answer

Answers

  • alesnavalesnav Posts: 19Questions: 5Answers: 1
    Answer ✓

    Well, you have an option for this called columns... Solved here

    $(document).ready( function () {
      var table =   $('#example').DataTable( {
            dom: 'Bfrtip',
            buttons: [
                {
                    extend: 'colvis',
                    collectionLayout: 'fixed two-column',
                    columns: ':not(.never)'
                }
            ],
            responsive: true
        } );
    } );
    

    I think that you can close this thread :P

This discussion has been closed.