Beating the IE Dead Horse... continues..

Beating the IE Dead Horse... continues..

sh_devsh_dev Posts: 1Questions: 0Answers: 0
edited February 2012 in DataTables 1.8
One of our developers had contacted earlier for the IE script error issue -"A script on this page may be busy...". (http://datatables.net/forums/discussion/4739/beating-the-ie-dead-horse/p1).
We are implementing datatables for sorting, filtering and pagination and it worked for 2k rows. For a POC we have moved sorting to server side and redrawing the table. We are not going completely server side as it might overload the server and trying to take a hybrid approach. Now IE works for around 4k rows but we would like to achieve higher numbers.

We are using the jquery.dataTables.delayedRendering.js version of DataTables. The table is showing 75 rows on a page and has 16 columns (only 5 visible). So when a column is clicked for sorting JSON data is passed to datatables, it clears the table, filters the data and then redraws the table. IE works fine on page loads but starts throwing the script busy error when the table is redrawn with new sorted data. Below code is called when sorted data is reloaded. Is there any optimization which can be implemented for IE to increase total number of rows in the datatable?

[code]
aaaData = [aaData.slice(0,1999), aaData.slice(2000,3999), aaData.slice(4000,5999), aaData.slice(6000,7999), aaData.slice(8000,9999)];
window.setTimeout(function(){
SH.ticketTable.fnClearTable( false );
window.setTimeout(addDrawTable,0);
}, 0);

var addDrawTable = function(){
if (aaaData[0] != undefined){
SH.ticketTable.fnAddData(aaaData[0],true);
}
var ind;
for ( i = 1; i<5; i++) {
var f = function(ind) {
return function () {
SH.ticketTable.fnAddData(aaaData[ind],false);
if(ind==4){
window.setTimeout(function() {SH.ticketTable.fnDraw(true);},10);
}
}
} (i)
window.setTimeout(f, 0);
};
}
[/code]

Replies

  • allanallan Posts: 61,743Questions: 1Answers: 10,111 Site admin
    > We are using the jquery.dataTables.delayedRendering.js version of DataTables.

    What is that script?

    Since you are using server-side processing, the table should very easily cope with millions of rows. To help negate the impact on server load, you might consider using pipelining: http://datatables.net/release-datatables/examples/server_side/pipeline.html and the filter delay plug-in: http://datatables.net/plug-ins/api#fnSetFilteringDelay .

    However, since you are only working with 4000 rows, I would suggest that server-side processing isn't really required. You can Ajax load the data and use deferred rendering: http://datatables.net/release-datatables/examples/ajax/defer_render.html .

    IE should be able to keep up with that no problem.

    Allan
This discussion has been closed.