Initialize table after div load

Initialize table after div load

AASAAS Posts: 7Questions: 5Answers: 0

Hello,
Im using AJAX to load a php page on a div element when selecting a dropdown select.
The problem is my table initialized on $(document).ready, but at that time the table is not loaded.
how can I initialize my table when the div is loaded?

Thanks!

Answers

  • colincolin Posts: 15,118Questions: 1Answers: 2,583

    Hi @AAS ,

    There's two ways you could go.

    The first, is to let DataTables control the ajax as in these examples here - that way the table is initialised and the data loaded when it returns.

    The second is to initialise or load the data in the Ajax success function, as shown in this thread.

    Cheers,

    Colin

This discussion has been closed.