One datatable from many sources (many ajax call)
One datatable from many sources (many ajax call)
hello,
I have the need to use datatable to show results from many sources loaded dynamically in javascript.
When I come to the page i will have 30/40/50 different ajax call made to different url (delayed by 50/100 ms each).
Previously I have read about prepare all those data server side and after that provide them to data table.
But I don't want my user has to wait unitl the last one is finished to show him the results but i want results are shown just when they are ready.
So at the start i will have 0 rows, after that 5 rows, after some seconds 15 row, and so on. So i need to "add rows" (and maybe RE-sorting the table after that) dynamically when I have back the result from the server.
Is it possible to do that?
Should I reset data and re-create the table each time? there is some other solution?
Thank you
Answers
Use
rows.add()
to add rows to the Datatable.Kevin