Reinitialize datatable
Reinitialize datatable
chait
Posts: 5Questions: 2Answers: 0
Hi,
I am using 'data' to initialize table. Now I want to reload the data to the table making external ajax call and pass the data. how to reinitialize the datatable I see ajax.reload is the option to reload the datatable. Since I am making ajax call in the script and passing the data to the datatable. What are my options to reload the datatable now?
This question has accepted answers - jump to:
This discussion has been closed.
Answers
If you are making the Ajax call yourself, use
clear()
androws.add()
to first clear the table and then add the new data. Finish with a call todraw()
.Allan
Hi Allan,
Thanks for the reply I did the same thing, as you suggested.
Below is code sample,
function testDataTables() {
Thing is this piece of code is working as expected in Chrome,
but somehow it's not working in Internet explorer.
I am having hard time figuring this issue could you help me out.
Thanks,
chait.
Hi Allan,
I figured out this issue. In datatables api which makes ajax calls has set the cache to false. In my external ajax call which I use to initialize the datatable caches the response, so any subsequent calls to the server still uses the previous response.
Thanks,
Thanks for posting back. Good to hear you have it working now.
Allan