DataTables 1.9.0 - Setting Defaults - Not working in IE8 and below
DataTables 1.9.0 - Setting Defaults - Not working in IE8 and below
sanelson
Posts: 12Questions: 0Answers: 0
I just downloaded the 1.9.0 release and decided to try give the defaults a spin, which is a great feature, BTW. It works great in IE9, Chrome, and Firefox, but in IE8 (can also be reproduced in IE9 running in IE8 mode or compatibility mode).
Here's my code, if it helps.
This function is being run when the page loads.
[code]
$(document).ready(function () {
// Set DataTable defaults
$.extend($.fn.dataTable.defaults, {
"bJQueryUI": true
,"sPaginationType": "full_numbers"
,"sDom": '<"H"<"toolbar"><"title">fr>t<"F"lip>'
,"sScrollX": "100%"
,"bScrollCollapse": true
,"bAutoWidth" : false
,"fnInitComplete": function(oSettings, json) {
var title = $(this).attr("data-title");
if (title) {
$(this).parents(".dataTables_wrapper").find(".title").text(title);
}
}
});
});
[/code]
I'm using AJAX to load a table and then run the following script directly afterwards
[code]
$('#user-datatable').dataTable({
'aoColumns': [
null
,{'asSorting': []}
,null
,null
,null
,null
,null
,null
,null
,null
,null
]
});
[/code]
In modern browsers this works great, but in IE <= 8 none of the defaults are getting set. If I change the dataTable call where I'm actually creating the table to include the defaults, then it works in IE8.
Here's my code, if it helps.
This function is being run when the page loads.
[code]
$(document).ready(function () {
// Set DataTable defaults
$.extend($.fn.dataTable.defaults, {
"bJQueryUI": true
,"sPaginationType": "full_numbers"
,"sDom": '<"H"<"toolbar"><"title">fr>t<"F"lip>'
,"sScrollX": "100%"
,"bScrollCollapse": true
,"bAutoWidth" : false
,"fnInitComplete": function(oSettings, json) {
var title = $(this).attr("data-title");
if (title) {
$(this).parents(".dataTables_wrapper").find(".title").text(title);
}
}
});
});
[/code]
I'm using AJAX to load a table and then run the following script directly afterwards
[code]
$('#user-datatable').dataTable({
'aoColumns': [
null
,{'asSorting': []}
,null
,null
,null
,null
,null
,null
,null
,null
,null
]
});
[/code]
In modern browsers this works great, but in IE <= 8 none of the defaults are getting set. If I change the dataTable call where I'm actually creating the table to include the defaults, then it works in IE8.
This discussion has been closed.
Replies
No comments, and I haven't seen anyone else report this issue. Has anyone else noticed this, or am I just doing something totally wrong?
Thanks.
[code]
// Set DataTable defaults
$.extend($.fn.dataTable.defaults, {
"bJQueryUI": true
,"sPaginationType": "full_numbers"
,"sDom": '<"H"<"toolbar"><"title">fr>t<"F"lip>'
,"sScrollX": "100%"
,"bScrollCollapse": true
,"bAutoWidth" : false
,"fnInitComplete": function(oSettings, json) {
var title = $(this).attr("data-title");
if (title) {
$(this).parents(".dataTables_wrapper").find(".title").text(title);
}
}
});
$(document).ready(function() {
$('#example').dataTable();
} );
[/code]
but the defaults are being applied in IE7+.
Can you link me to a test case where it isn't working please?
Allan