Data loads quickly in IE8, but browser chokes on scrolling
Data loads quickly in IE8, but browser chokes on scrolling
Rypens
Posts: 8Questions: 0Answers: 0
Hello,
I load my data with sAjaxScource, i have bDeferRender on true and i have the 1.9.1 version running. The data loads rapidly on all browsers (IE8 around 2 secs) but when all data is loaded, IE8 chokes when you start scrolling or clicking somewhere on the page (other browsers are fine). Other pages on the website are not experiencing this behaviour.
Any ideas? FYI, I'm using Datatables in tabs.
My code:
[code]
var table5 = $('#open').dataTable( {
"bProcessing": true,
"sAjaxSource": "<?= site_url(sprintf('status/gettable/%s/open', $dealer->dealerID)) ?>",
"bJQueryUI": true,
"bSortClasses": false,
"aaSorting": [[7,'desc']],
"bAutoWidth": true,
"bInfo": true,
"sScrollX": "100%",
"bDeferRender": true,
"aoColumnDefs": [
{ "bSortable": false, "aTargets": [ 8 ] },
{ "sClass": "bold", "aTargets": [ 4 ] },
{ "sClass": "charset", "aTargets": [ 5 ] },
{ "sWidth": "20%", "aTargets": [ 2 ] }
],
"sScrollXInner": "100%",
"iDisplayLength": 50,
"bScrollCollapse": true,
"sPaginationType": "full_numbers",
"bRetrieve": true,
"fnInitComplete": function () {
$("#dt5 .dataTables_length > label > select").uniform();
$("#dt5 .datatable tbody td").addClass("text");
$("#dt5 .dataTables_filter input[type=text]").addClass("text");
$(".datatable").css("visibility","visible");
}
} );
$(window).resize(function(){
if (table5) {
table5.fnAdjustColumnSizing();
}
});
[/code]
I load my data with sAjaxScource, i have bDeferRender on true and i have the 1.9.1 version running. The data loads rapidly on all browsers (IE8 around 2 secs) but when all data is loaded, IE8 chokes when you start scrolling or clicking somewhere on the page (other browsers are fine). Other pages on the website are not experiencing this behaviour.
Any ideas? FYI, I'm using Datatables in tabs.
My code:
[code]
var table5 = $('#open').dataTable( {
"bProcessing": true,
"sAjaxSource": "<?= site_url(sprintf('status/gettable/%s/open', $dealer->dealerID)) ?>",
"bJQueryUI": true,
"bSortClasses": false,
"aaSorting": [[7,'desc']],
"bAutoWidth": true,
"bInfo": true,
"sScrollX": "100%",
"bDeferRender": true,
"aoColumnDefs": [
{ "bSortable": false, "aTargets": [ 8 ] },
{ "sClass": "bold", "aTargets": [ 4 ] },
{ "sClass": "charset", "aTargets": [ 5 ] },
{ "sWidth": "20%", "aTargets": [ 2 ] }
],
"sScrollXInner": "100%",
"iDisplayLength": 50,
"bScrollCollapse": true,
"sPaginationType": "full_numbers",
"bRetrieve": true,
"fnInitComplete": function () {
$("#dt5 .dataTables_length > label > select").uniform();
$("#dt5 .datatable tbody td").addClass("text");
$("#dt5 .dataTables_filter input[type=text]").addClass("text");
$(".datatable").css("visibility","visible");
}
} );
$(window).resize(function(){
if (table5) {
table5.fnAdjustColumnSizing();
}
});
[/code]
This discussion has been closed.
Replies
asadob
[code]$(window).resize(function(){
if (table5) {
table5.fnAdjustColumnSizing();
}
});[/code]
It seems that in IE8, the resize function is called, even when the window isn't resized... That's why the browser chokes.
Hope i helped someone else with this...
@Rypens - good to hear you got it fixed.
Allan
@allan or jcready - it seems that window resize event on IE8 is stuck in an infinite loop *only* when I am calling fnAdjustColumnSizing inside the event.
1) Any idea why? (out of curiosity)
2) I tried calling w/ the debounced script, but the event still fires unprompted. What am I doing wrong? (Or, is it as I've suspected, calling fnAdjustColumnSizing causes a windows resize misfire in IE8?)
[code]
$(window).bind("debouncedresize", function() {
alert('event fired: '+ (+new Date()) );
// redraw the table according to new widths
oTable.fnAdjustColumnSizing();
});
[/code]