Datatable Destroy() taking too much time.
Datatable Destroy() taking too much time.
shivanag
Posts: 7Questions: 2Answers: 0
In my application i'm loading huge data into data table. And in that datatable i want to search using some search filters.
In that case, what i am doing is i'm destroying the previously loaded table and again loading data by search filters again.
Here the problem is because of huge data like 50k records its taking too much time to destroy data table, and some times page it self not responding.
So is there any other way to handle this ?
This discussion has been closed.
Answers
Why do you need to destroy the table? Can't you use the
clear()
androws.add()
methods?Allan
No, Actually we need to re intialise that table. because already rows are there.
Hi Shivaaaa,
I got your answer. if u have a large no of records(rows) and u r trying to destroy that, then it will take a no of time due to a bunch of HTML elements. so the easiest way to clear all the html content and then destroy the table.
for example please check the following code to do so.
var table=$("#Gridview").dataTable();
table.html('');
table.dataTable().fnDestroy();