Data Tables events not firing in IE 8?
Data Tables events not firing in IE 8?
Hi all, new to Data Tables. I've been working through the examples and things seem to be working for me well. I then tried to experiment with the events, but I'm not having much luck. I even tried the online example (below) using IE8 and notice when I trigger an event (sort, search, etc) only the first event getts triggered/logged to console. If I run the same example in FireFox, I see an event fired for each action I take. Needless to say I'm confused. Is this a bug?? Appreciate any info. Thanks!
Example: http://www.datatables.net/examples/advanced_init/dt_events.html
BTW: Here is a little example I wrote that works in FireFox, but NOT IE8. All it's supposed to do is do a javascript alert("Hey") everytime the datatable field is sorted.
<html>
<head>
<script type='text/javascript' src='//code.jquery.com/jquery-1.10.2.min.js'></script>
<script type='text/javascript' src='//cdn.datatables.net/1.10.0/js/jquery.dataTables.js'></script>
<script>
$(document).ready(function(){
$('#MyTable').on( 'order.dt', function () { alert("Hey") } ).dataTable();
})
</script>
</head>
<body>
<table id='MyTable'>
<thead>
<tr>
<td>Field1</td>
<td>Field2</td>
<td>Field3</td>
<td>Field4</td>
<td>Field5</td>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>a</td>
<td>3</td>
<td>b</td>
<td>5</td>
</tr>
<tr>
<td>a</td>
<td>2</td>
<td>c</td>
<td>3</td>
<td>e</td>
</tr>
</tbody>
</table>
</body>
</html>
Answers
I have just encountered the same issue, and I am under the impression this may be a JQuery issue instead of being the 'fault' of Datatables
More info - I found that performing a predraw using fnUpdate or columns.adjust() seems to cause a similar problem
Could you possibly try this with the DataTables nightly from the downloads page please? I think (hope!) this might be resolved already.
Allan
Hi all.
I have encountered same issue only on IE8.
Its works on IE9, Chrome and FF.