Disables the DataTables collapse function

0

Good! I needed to know if there is a way to prevent DataTables from collapsing the columns, and also if there is any way to use columns.visible to make the column invisible, but not space too!

For easier understanding:

This is what I want to always happen:

Butsometimesthedatatablesdothis,puttingtheOperationscolumninachildtd...

    
asked by anonymous 27.06.2018 / 10:47

1 answer

0

You can disable this behavior with the "responsive" setting by setting the "details" option to false . So, in the DataTable configuration:

$(document).ready(function() {
  $('#tabela').DataTable( {
      //... outras configurações
      responsive: {
          details: false
      }
  } );
} );

This way the childs will not appear, but if you want to show them by default, the configuration is this:

$(document).ready(function() {
  $('#tabela').DataTable( {
      responsive: {
          details: {
              display: $.fn.dataTable.Responsive.display.childRowImmediate,
              type: ''
          }
      }
    });
});
    
27.06.2018 / 16:53