DT event after complete rendering a table and all buttons?

DT event after complete rendering a table and all buttons?

ajungajung Posts: 14Questions: 5Answers: 0

For legacy reasons, we have long HTML table (5000 entries) and apply DataTable to the existing markup.
DT takes a few seconds to initialize the table, render the buttons etc.
I want to hide the table initially and display it after DT is completely finished.
Is there an event that is fired after completion/complete initialization?
We are using latest DT 2 version.

Answers

  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin

    Yes, init is triggered. Or you can also use initComplete as a callback if you prefer.

    One thing to note is that if the table initialisation does not use ajax, then its initialisation will be synchronous i.e. the init event would already have triggered by the time the code completes running!

    The new ready() function can be used to help address any possible confusion with that.

    Allan

  • ajungajung Posts: 14Questions: 5Answers: 0

    Thanks!
    ready() did the job

  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin

    Awesome.

    I like the new ready() function. It doesn't do anything other code can't, but it does make like a lot easier...

    Allan

Sign In or Register to comment.