ajax dt - responsive not working on first page load

ajax dt - responsive not working on first page load

mclovinnmclovinn Posts: 2Questions: 1Answers: 0

Hi,
im working with ajax and dt, everything works just fine and as expected. Except for one thing. The tables wont resize automaticly to the width of the scree but only on the first page load. After i filter the table or manualy readjust the browser window the table gets resized acordningly. I call the dt within "$(document).ready(function()".
Im not sure where an what to change. Im glad for any help.

Here is my dt code:
https://jsfiddle.net/0t493jnb/

The ajax response is:
"draw" => intval($draw), -> eg. "1"
"iTotalRecords" => $totalRecords, -> eg. "1"
"iTotalDisplayRecords" => $totalRecordwithFilter, -> eg. "1"
"aaData" => $data -> Array with the column content"

cheers
Mauro

Answers

  • mclovinnmclovinn Posts: 2Questions: 1Answers: 0

    window.dispatchEvent(new Event('resize'));

    solved the problem

This discussion has been closed.