IE8 stop running script problem
IE8 stop running script problem
Hello everyone,
I am now facing a problem that the ie8 will show a pop up showing" stop running the script.....". After I click the press the "NO" button, the table is correctly rendered without any problem. The table is going to show about 14k records with 10 rows per page. It works like a charm in Firefox and Chrome.
The code to generate the table is:
[code]
oTable = $('#location').dataTable( {
"oLanguage": {
"sSearch": "Search all columns:"
},
"bSort": false,
"bSortClasses": false,
"bDeferRender": true,
"bProcessing": true,
"aoColumns": [{"sWidth":"3%"},{"sWidth":"20%"},{"sWidth":"25%"},{"sWidth":"26%"},{"sWidth":"26%"}],
<%=locationTableList.substring(1,locationTableList.length()-1)%>
} );
[/code]
". the "<%....%>" is something like
[quote]"aaData":[["\u003cinput type\u003d\"checkbox\" name\u003d\"location_selectedRow\"\tclass\u003d\u0027chk\u0027 value\u003d\"xxx\" /\u003e","xxxx","xxx - xxxx","xxx","xxx"],["\u003cinput type\u003d\"checkbox\" name\u003d\"location_selectedRow\"\tclass\u003d\u0027chk\u0027 value\u003d\"xxx\" /\u003e","xx","xxxx - xxx","xxxx","xxxx\r"],......
[/quote]
As this is mainly the large data problem and the html and js are simple, so i do not use the DataTables live for it. If you really need it, I will place it.
I have make some researches on the forum and Google and I tried the following suggestions.
1. disable sorting column classes with bSortClasses ( http://datatables.net/usage#bSortClasses )
2. disable (or optimise) sorting
3. use jquery.dataTables.delayedRendering.js from http://datatables.net/dev/jquery.dataTables.delayedRendering.js
4. set "bServerSide": true
For items 1,2,4, there is no significant improvement. For item 3, there is error showing "Uncaught TypeError: Cannot call method 'getElementsByTagName' of null" in chrome and " 'aoData[...].nTr' is null or not an object jquery.dataTables.delayedRendering.js, line 5560 character 5" in IE 8. I wonder whether I miss use the delayedRendering js or this js isn't compatible with the datatables 1.9.4?
Sorry for my poor English, but I have tried my best to describe the situation.
May I know there is an update on the delayedRender js or any other workaround for this situation?
Thanks a lot.
If anything is not clear, please let me know. I will try to describe it more.
I am now facing a problem that the ie8 will show a pop up showing" stop running the script.....". After I click the press the "NO" button, the table is correctly rendered without any problem. The table is going to show about 14k records with 10 rows per page. It works like a charm in Firefox and Chrome.
The code to generate the table is:
[code]
oTable = $('#location').dataTable( {
"oLanguage": {
"sSearch": "Search all columns:"
},
"bSort": false,
"bSortClasses": false,
"bDeferRender": true,
"bProcessing": true,
"aoColumns": [{"sWidth":"3%"},{"sWidth":"20%"},{"sWidth":"25%"},{"sWidth":"26%"},{"sWidth":"26%"}],
<%=locationTableList.substring(1,locationTableList.length()-1)%>
} );
[/code]
". the "<%....%>" is something like
[quote]"aaData":[["\u003cinput type\u003d\"checkbox\" name\u003d\"location_selectedRow\"\tclass\u003d\u0027chk\u0027 value\u003d\"xxx\" /\u003e","xxxx","xxx - xxxx","xxx","xxx"],["\u003cinput type\u003d\"checkbox\" name\u003d\"location_selectedRow\"\tclass\u003d\u0027chk\u0027 value\u003d\"xxx\" /\u003e","xx","xxxx - xxx","xxxx","xxxx\r"],......
[/quote]
As this is mainly the large data problem and the html and js are simple, so i do not use the DataTables live for it. If you really need it, I will place it.
I have make some researches on the forum and Google and I tried the following suggestions.
1. disable sorting column classes with bSortClasses ( http://datatables.net/usage#bSortClasses )
2. disable (or optimise) sorting
3. use jquery.dataTables.delayedRendering.js from http://datatables.net/dev/jquery.dataTables.delayedRendering.js
4. set "bServerSide": true
For items 1,2,4, there is no significant improvement. For item 3, there is error showing "Uncaught TypeError: Cannot call method 'getElementsByTagName' of null" in chrome and " 'aoData[...].nTr' is null or not an object jquery.dataTables.delayedRendering.js, line 5560 character 5" in IE 8. I wonder whether I miss use the delayedRendering js or this js isn't compatible with the datatables 1.9.4?
Sorry for my poor English, but I have tried my best to describe the situation.
May I know there is an update on the delayedRender js or any other workaround for this situation?
Thanks a lot.
If anything is not clear, please let me know. I will try to describe it more.
This discussion has been closed.
Replies
Allan
Really thanks for your reply! As I already disable the sorting and enable deferred rendering, I guess I have to try Ajax loading instead of giving a JavaScript array in the initialization. I hope this could help and thanks for your help again.
/* Create an array with the values of all the checkboxes in a column */
$.fn.dataTableExt.afnSortData['dom-checkbox'] = function (oSettings, iColumn) {
var aData = [];
//fix for slow load with large data using IE ' 20121102 begin
// $('td:eq(' + iColumn + ') input', oSettings.oApi._fnGetTrNodes(oSettings)).each(function () {
// aData.push(this.checked == false ? "1" : "0"); // false has checked items sorted to the top
// });
x=oSettings.oApi._fnGetTrNodes(oSettings);
for (var i = 0, iLen = oSettings.aoData.length; i < iLen; i++) {
thisRBG=$('td:eq(' + iColumn + ') input',x[i])
aData.push(thisRBG[0].checked == false ? "1" : "0"); // false has checked items sorted to the top
}
//fix for slow load with large data using IE ' 20121102 end
return aData;
}
Hi rbglover,
Really thanks for your suggestion! As I didn't apply any sorting in the table now and I didn't have the above afnSortData function, I guess the reason may not be the sorting part. It should be in initialization part. Do you know whether there is a work around to avoid that popup easily? Thanks.
Hi Allan,
I have try to load the data from an Ajax source, but the situation is worse than sourcing from a JavaScript array directly. If i can't solve it in a easy way, I have to implement the server side processing part for that. Thanks for your suggestions.