Disables Datatables Collapse function

Asked

Viewed 20 times

0

Good! I needed to know if there is a way to prevent Datatables from giving Collapse to the columns, and also if there is some way beyond using Columns.Visible to make the column invisible, but also not taking up space!

For easier understanding:

This is what I want to always happen: inserir a descrição da imagem aqui

But sometimes datatables do this by putting the Operations column on a tdChild... inserir a descrição da imagem aqui

1 answer

0

You can disable this behavior with the "Responsive" setting by setting "Details" as false. It looks like this in the Datatable configuration:

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

That way Childs won’t appear, but if you want to show them by default, the setting is this:

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

Browser other questions tagged

You are not signed in. Login or sign up in order to post.