reuse ajax source for multiple tables on the same page
reuse ajax source for multiple tables on the same page

Hi,
First of all happy new year and WOW WHAT A GREAT MODULE!
I'm using datatables with ajax. I have multiple datatables on the same page displaying data from the same data source. How can I prevent requesting the exact same ajax data source multiple times?
Test case: http://live.datatables.net/yiluxude/1/edit
In this case http://live.datatables.net/examples/ajax/data/objects.txt is requested three times, once for every table. How can I make it request the data source only once and reuse this in all three datatables?
This question has an accepted answers - jump to answer
Answers
Hi,
Happy New Year.
What I would suggest is that you make the Ajax call to get the data yourself using
$.ajax()
and then use thedata
option, orrows.add()
method, to add the data tot he tables.Allan
Thanks that did the trick