Buttons colvis not working with hide fields

Buttons colvis not working with hide fields

rodneyrarodneyra Posts: 2Questions: 0Answers: 0

When I start a table with a hide column and then press the colvis button to show the column, the column header does not appear. I´ve already tried hiding the column by id or by class name and the results are the same.

The table configuration is:

========================================
var table = $('#generic-table').DataTable( {
dom: 'lBfrtip',
colReorder: true,
buttons: [
{
extend: 'colvis',
postfixButtons: [ 'colvisRestore' ]
}
]
} );

table.columns( '.hide' ).visible( false );

=======================================

The HTML is:

============================

<table id="generic-table" class="table table-striped table-bordered" cellspacing="0" width="100%">

    <thead>
    <tr>
    <th>Col1</th>
    <th>Col2</th>
    <th class="hide">Col3</th>
    <th>Col4</th>
    </tr>
    </thead>

    <tbody>

.....

DataTable version: 1.10.15

Can anyone help me?

Thanks

Sign In or Register to comment.