How to clean up before calling destroy()?
How to clean up before calling destroy()?

What is a proper way to clean up any pending datatable events or other artifacts before calling destroy()?
I am seeing symptoms that suggest that some transients are being left after the destroy() call, which is immediately followed in the code by a new instantiation of the same dataTable. I feel like I should be typing "destroy().then{...}" or otherwise implementing some sort of asynchronous completion routine.
Thanks in advance for not scolding my lack of an MWE.
This discussion has been closed.
Answers
This is according to the
destroy()
docs:Can you provide details of what you are seeing?
You may need to clean up any events you added. You may need to use jQuery empty() if you are changing the number of columns. See the second example in the
destroy()
docs.Kevin