ajax.reload is lazy-loading and resizing
ajax.reload is lazy-loading and resizing
Hello together,
it's my first time working with DataTables but I really enjoy the functionality of the framework.
While developing i happened to get two behaviours i didn't expect:
Resizing
I have a server-side-processed dataTable on my page which is initialized when the document is ready (jQuery).
Sometimes the width of the table-header-row isn't calculated probably so the visual result looks kinda buggy.
The table body is sized perfectly after loading the data but the header-row is only at minimum width and not as wide as the body.ajax.reload
The API-Method ajax.reload seems to be lazy-loading. It only works for me if i change a property of the API-object via the search method (or any other method) before i call ajax.reload.
Is there anyway to force the ajax reload?
Greetings dvol
This question has an accepted answers - jump to answer
Answers
General recommendation is to add
width="100%"
to thetable
. If the table is not visible when initialized then usecolumns().adjust()
when it becomes visible.Are you using
ajax
within the Datatables init code? If the ajax config is outside of Datatables thenajax.url().load()
might work. Although if you are using additional ajax parameters outside of DT like POST they won't be used.If this doesn't help then please post a link to your page or a test case so we can see what you are doing.
Kevin
Thx for the fast response and have a nice day!