Json language file deletes Custom toolbar element

Json language file deletes Custom toolbar element

denonbwdenonbw Posts: 2Questions: 1Answers: 0

Hello and thank you for the great project!
I created a custom toolbar element following this guide.

https://datatables.net/examples/advanced_init/dom_toolbar.html

It works perfectly fine as long as I don't load a JSON language file.
Once I include the language file, the custom toolbar element no longer appears in the display.
An example can be found here:

https://live.datatables.net/cimoxuse/1/edit

Once I comment out the URL, the custom toolbar element reappears.
Is there an interaction that I'm overlooking?

Thank you, and have a great day!

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,446Questions: 1Answers: 10,465 Site admin
    Answer ✓

    This part in the language.url documentation is key for this:

    Note that when this parameter is set, DataTables' initialisation will be asynchronous due to the Ajax data load. That is to say that the table will not be drawn until the Ajax request has completed. As such, any actions that require the table to have completed its initialisation should be placed into the initComplete callback.

    Do that, and it will work :)

    Allan

  • denonbwdenonbw Posts: 2Questions: 1Answers: 0

    Hello Allan,
    Thank you very much for your quick and great response. I appreciate it and wish you a fantastic day!

Sign In or Register to comment.