Responsive Javascript file seems to be buggy

Responsive Javascript file seems to be buggy

aldemarcalazansaldemarcalazans Posts: 12Questions: 1Answers: 0

Hi. It seems that dataTables.responsive.min.js, in its versions 2.0.1, 2.0.2, 2.1.0, 2.1.1 are all buggy. See:

Inline Google Spreadsheet Viewer - responsive layout not working properly.

The same problem occured with another WordPress plugin:

TablePress - responsive layout not working properly

Answers

  • aldemarcalazansaldemarcalazans Posts: 12Questions: 1Answers: 0

    By the the way: the titles of the posts are inverted!

  • allanallan Posts: 61,446Questions: 1Answers: 10,054 Site admin

    Responsive 2.2.0 is the current version of Responsive. If you are having problems with it, please link to a test case, as noted in the forum rules so we can help to debug it.

    Allan

  • aldemarcalazansaldemarcalazans Posts: 12Questions: 1Answers: 0

    Hi Allan. This is the page where I am using version 2.0.0 of dataTables.responsive.min.js

    www10.trf2.jus.br/conciliacao/resultados/resultado-mutiroes-de-conciliacao-2016/

    And this is the page where I am using version 2.1.1 of dataTables.responsive.min.js

    www10.trf2.jus.br/administracao/resultados-teste/

    I am using the WordPress plugin TablePress 1.4, but the problem also happened with another plugin, Inline Google Spreadsheet Viewer, and was solved downgrading the version of the JS file already mentioned.

  • allanallan Posts: 61,446Questions: 1Answers: 10,054 Site admin

    Thanks for the test case.

    I believe the issue is that you need to add either width="100%" or style="width:100%;" to the HTML for your table:

    <table id="tablepress-1" class="tablepress tablepress-id-1">
    

    Without that DataTables can't know that the table is meant to be 100% width (its unbelievably difficult to get a % width out of a stylesheet defined width!) so it doesn't automatically perform its redraw calculations. Adding one of those attributes in should resolve that.

    The automated tests in the debugger also indicate this as an issue.

    Allan

  • aldemarcalazansaldemarcalazans Posts: 12Questions: 1Answers: 0

    Allright, although it seems to me that the older code was more inteligent than the new one.
    I will try to warn both plugin developers (TablePress and Inline Google Spreadsheet Viewer) about this issue. Otherwise, many people that use these plugins will suffer with the lack of responsiveness of their pages.

This discussion has been closed.