Table gets garbled

Table gets garbled

veloopityveloopity Posts: 87Questions: 36Answers: 2
edited December 2015 in DataTables 1.10

my datatables table has 2 fixed columns on the left (they contain text and their width varies wildly), and paging is set to true. When I click on the next pages, the first columns get cut off and some of them disappear, different on each page. Sometimes, an extra horizontal scrollbar is even displayed for the first columns. Are paging and several fixed columns officially incompatible? is there some kind of trick that I should use? has anyone used this combination successfully? I have already disabled word-wrap for table cells as that confused the layout even more.

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,695Questions: 1Answers: 10,500 Site admin

    That sounds fairly messy! Are you able to give me a link to a test page showing that issue?

    Thanks,
    Allan

  • allanallan Posts: 63,695Questions: 1Answers: 10,500 Site admin

    Thanks for the link via e-mail. I've just replied back by e-mail, but for completeness and anyone else who finds this issue, it looks like a error that is being caused by the changing with of the second column as the page is changed. I've just committed a fix which is now available in the nightly version of FixedColumns.

    Or if you prefer, you could add the following to your DataTables initialisation which will also correct the error:

        initComplete: function () {
            this.api().fixedColumns().relayout();
        }
    

    Allan

  • veloopityveloopity Posts: 87Questions: 36Answers: 2

    this doesn't work - the table won't be displayed at all when I add this

  • allanallan Posts: 63,695Questions: 1Answers: 10,500 Site admin
    Answer ✓

    Again for anyone else reading this, I should have used drawCallback rather than initComplete in the above code snippet!

    Allan

  • veloopityveloopity Posts: 87Questions: 36Answers: 2

    thx Allan, works like a charm

This discussion has been closed.