DataTables 2.0 scrollX and responsive issue

DataTables 2.0 scrollX and responsive issue

RenSwordRenSword Posts: 5Questions: 1Answers: 0
edited September 19 in Free community support

https://live.datatables.net/huponixu/1/edit

There are 2 issues
1. Sometimes horizontal scrollbar appear when its not needed. It should hide column responsively.
2. On the top table, press "click me" to add new row, it break the table measurement and keep showing horizontal scrollbar instead of being responsive. Calling columns.adjust() or responsive.recalc() cant fix the top table also.

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 22,297Questions: 26Answers: 5,126
    edited September 19

    My question is why do you want to use responsive and scrollX at the same time. They are different/competing solutions to solve the same problem of keeping the Datatable within the container. I don't believe the intention or expectation is that they would be used together.

    Kevin

  • allanallan Posts: 65,216Questions: 1Answers: 10,805 Site admin

    I don't believe the intention or expectation is that they would be used together.

    Correct. The idea of Responsive is that the table will never scroll horizontally, so x-scrolling is redundant.

    Allan

  • RenSwordRenSword Posts: 5Questions: 1Answers: 0
    edited September 22

    My use case is set 3 column as responsive all class column, while all other column can be responsively hidden, that 3 column sometimes may not have enough space to show, I need scrollX for this,
    it used to not have this problem in datatables 1.10.x, (I can call .columns.adjust.responsive.recalc()... to redraw it in 1.10.x, but now the top table forever have horizontal scrollbar after adding new row)

  • allanallan Posts: 65,216Questions: 1Answers: 10,805 Site admin
    Answer ✓

    I've never considered that use case before I'm afraid. It isn't something that I'd tested for and it isn't something that it was designed for. As I say, the idea what that horizontal scrolling and Responsive were mutually exclusive.

    If it worked in an old version it was a total fluke - not at all intentional!

    Sorry I don't have better news at the moment. It is certainly something that I can look at implementing if we get enough feedback asking for it.

    Allan

Sign In or Register to comment.