DataTables no longer resizes after .columns.adjust().draw()

DataTables no longer resizes after .columns.adjust().draw()

CableMonkey42CableMonkey42 Posts: 2Questions: 1Answers: 0
edited May 2015 in Free community support

Please note that my Javascript and modern HTML/CSS skills are probably much less than the typical visitor to this page, so please forgive me if problem is quite an elementary-level fix.

I have created a very basic table and have gotten it working with DataTables with Bootstrap integration. I am able to resize the window and have the table automatically readjust its size; however, the second I have it call .columns.adjust().draw(), the table suddenly forgets how to resize. Anyone have any hints on what I'm overlooking to get this functionality back?

Example without .columns.adjust().draw():
http://pastebin.com/iV5cNPtB

Example with .columns.adjust().draw():
http://pastebin.com/8XhMycms

This question has an accepted answers - jump to answer

Answers

  • cpowercpower Posts: 11Questions: 3Answers: 2
    Answer ✓

    add this parameter it should do the trick.
    "sScrollX": "100%",

    I think columns.adjust() is not called when you resize the window so it is essentially not doing any good for you.

  • CableMonkey42CableMonkey42 Posts: 2Questions: 1Answers: 0

    You, cpower, are awesome! That fixed the issue for me. Thank you very much!

This discussion has been closed.