How to use DataTables.net

I recently noticed that the datatables on my projects started showing a “no data available in table” error. After some fiddling I found out that when I initiate the script to load the datatable manually, it does work. So there was a timing issue.

Now the weird thing is that I ran the script on succes of the serverconnect file that fills the table. But it still seems to be to early. When I add delay:1 to a flow, before running the script, it does work.

Does anybody understand why this is? Shouldn’t the onsuccess thing make sure it waits until the data is available?