Reputation: 41595
I wonder if there's any way to speed up fnUpdate
function when applying it to many rows.
In my case I am using it to update for example 10 cells of 10 different rows and I am noticing it is not so fast as expected. Its a bit laggy.
I've seen than a common technique to improve the performance when updating the DOM is to to do it at once instead of looping. This way, the browser will only reflow the page once and will speed up the process.
Is there any way to do it in datatables plugin making of of fnUpdate function? Thanks.
Upvotes: 2
Views: 895
Reputation: 423
It might be helpful that you try the 4th and 5th option of fnUpdate, which disables updating the entire table right after updating the cell. You can do the whole table update when all changes are done.
for(i = 0; i < rows ; i++)
{
dataTable.fnUpdate( "Sample Data", i, 3, false, false );
}
dataTable.fnDraw();
Upvotes: 4