Datatable on hidden tab-page doesn't react on columns.adjust()

Datatable on hidden tab-page doesn't react on columns.adjust()

VyacheslavVyacheslav Posts: 70Questions: 27Answers: 0

I have two tabs with identical tables https://datatbl.herokuapp.com/users
First datatable is Ok, as it's on the first visible tab-page.
Second datatable is shrinked and even

$(document).on('shown.bs.tab', 'a[data-toggle="tab"]', function (e) {

  $.fn.dataTable.tables( {visible: true, api: true} ).columns.adjust();

});

... doesn't help.

Does anyone know what to do with it? ...

Answers

  • VyacheslavVyacheslav Posts: 70Questions: 27Answers: 0

    Unfortunately I'm not able to edit my post any more.
    The right link to problem is https://datatbl.herokuapp.com/tabs

    Just take a look at the Tab-2. Datatable looks shrinked(

  • UPEngineerUPEngineer Posts: 93Questions: 0Answers: 1
    edited November 2015

    I never could get that function to work. This is what I ended up doing and it worked.

    oTable.columns.adjust().draw();
    

    oTable would point to your Datatable instance.

  • VyacheslavVyacheslav Posts: 70Questions: 27Answers: 0

    Tried this variant. Not worked.

    oTable.columns.adjust().draw();
    

    Perhaps it had worked in recent versions of datatable, but now it doesn't work any more

    Allan is my only hope.

This discussion has been closed.