Responsive table crash

Responsive table crash

LucasJrLucasJr Posts: 7Questions: 3Answers: 1

Hi again!

I'm using DataTables, Bootstrap 3, FixedHeader, ColReorder, Buttons and Responsive in that DataTable.
It is responsive, but when the window reach a little size, that crashes.

Here is an example of the screen working perfectly in reduced size:
http://imagizer.imageshack.us/a/img911/2628/lzHhTh.png

Here I reduced a little more and the bug appears:
http://imageshack.com/a/img633/5953/ptZbj1.png

There is the js source of table.

var table =   $('#grid_tbl').DataTable( {
        lengthChange: false,
        colReorder: true,
        fixedHeader: true,
        "aaSorting": [0, "desc"],
        buttons: [
                  'pdfHtml5',
                  'excel'
              ],
        "sPaginationType": "full_numbers",
        "iDisplayLength": 300,
        "lengthMenu": [[100, 250, 500, 1000], [100, 250, 500, 1000]],
        "fnInitComplete": function() {
                this.fnAdjustColumnSizing(true);
        },
        "autoWidth": true,
    "dom": 'f<"top">B<"wraper"rt>i<"footer">p',
    "oLanguage": {
        "sSearch": "Pesquisa: ",
        "sLengthMenu": "Exibição _MENU_ registros",
        "sInfo": "Mostrando de _START_ até _END_ de _TOTAL_ registros",
        "oPaginate": {
          "sFirst": "primeira",
          "sNext": "próxima",
          "sPrevious": "anterior",
          "sLast": "última"
            }
        },
        "columnDefs": [                     
             {
             "targets": [ 0 ],
             "data": "codigo",
             "searchable": false
               },
              {
                 "targets": [ 12 ],
             "data": "modalidade",
             "visible": false,
             "searchable": false
                         }
                      ]
});

The container has set with width=80% and DataTable inside is set with 100%.

Another problem is "lengthMenu" don't appear anyway! I tried a million ways. The "dom" is above too.

Answers

  • allanallan Posts: 63,552Questions: 1Answers: 10,477 Site admin

    Can you link to a test page showing the issue please.

    Another problem is "lengthMenu" don't appear anyway!

    You don't have the l option in the dom parameter.

    Allan

  • LucasJrLucasJr Posts: 7Questions: 3Answers: 1

    Thank you Allan, it was crashing by my fault.

    But, the lenght menu don't appear even with the l option.

  • allanallan Posts: 63,552Questions: 1Answers: 10,477 Site admin

    But, the lenght menu don't appear even with the l option.

    I'd need a link to the page or a debugger trace to understand why not.

    Allan

This discussion has been closed.