Datatables jquery-ui buttons and ajax
Datatables jquery-ui buttons and ajax

Buttons does not work on datatables with jquery-ui styling and ajax sourced data.
The example at: https://datatables.net/extensions/buttons/examples/styling/jqueryui.html works fine.
But if you try using ajax sourced data, the button wont appear. Its like it tries to add the button before table is ready.
Can someone give an example on how to make this work, without using the dom option?
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Due to the async nature of ajax you probably will need to use
initComplete
or theinit
event to install the buttons. Otherwise thetable.buttons().container().insertBefore( '#example_filter' );
code is executed too soon. Here is an example:http://live.datatables.net/cecemole/1/edit
Kevin
Hey kthorngren
Thanks for the answer! This did help me with a solution. Though my real problem was that I was importing both datatables v1.10.18 and v1.10.20.
Removing one of the imports solved my issue with the button not appearing.