DataTables no longer resizes after .columns.adjust().draw()
DataTables no longer resizes after .columns.adjust().draw()
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
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.
You, cpower, are awesome! That fixed the issue for me. Thank you very much!