Callback to use when multiple tables have finished loading
Callback to use when multiple tables have finished loading
Hi, I'm using Datatables v1.10. I'm wondering if there is a callback I can use to figure out if 2 or more tables have finished loading.
Currently I use the initComplete callback, and once the table has finished loading, I hide the wait icon and show the page with the table.
I initialize 2 tables together, but I would like to configure them separately, and find a way to figure out when both tables have finished loading. So i can hide the wait icon and show both tables.
I've tried using init.dt...but to no avail
Thank you in advance.
Answers
There isn't a callback that watches all Datatables for them to complete initialization. Maybe you can set a global flag for each Datatable in
initComplete
orinit
then see if the flag for all the Datatables has been set. If so then hide the wait icon.Kevin
got it, so use something like setinterval, to check every 100ms whether both the variables have been set to true?
I was thinking something like this:
Will let you test this to make sure it works in with your solution.
Kevin
I can confirm that it works!
Thank you sir, for the explanation and the example.