Setting table options with api (like scrollY)?
Setting table options with api (like scrollY)?
Hi, can I change some of the initialization options of my table by calling the API?
I'm looking for ways to change "scrollY", "scollX" and "responsive".
Thank you a lot!
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
In general most config options aren't changeable via the API. A few are but I don't believe the options you listed are. You can use
destroy()ordestroyto destroy the current Datatable then reinitialize with the new options.Kevin
It indeed works, however it seems that colReorder is broken: when I destroy and recriate the table at the same page, the columns data appear to consider the reorder, but the titles don't, even forcing a draw() some time after the creation.
Hi @lucasexato ,
We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.
Cheers,
Colin