I am updating a table dynamically using versions jquery-1.7.2.min, TableSorter 2.7.12 min, tableSorter 2.4+ widgets - updated 2/24/2013.
The code works fine in IE9 and Chrome but in IE8 the filter and zebra widgets stop working after an ajax update, the sort still works.
<table class="tablesorter">
<thead>
<tr>
<th style="width: 145px;">Orig_Time</th>
<th style="width: 145px;">Corra_Time</th>
<th style="width: 120px;">Site</th>
<th style="width: 120px;">Area</th>
<th>Reference</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
$(document).ready(function() {
$("table").tablesorter({
sortList: [[0, 1]],
widthFixed: true,
theme: 'green',
widgets: ["filter", "stickyHeaders"],
widgetOptions: {
stickyHeaders: "tablesorter-stickyHeader",
filter_cssFilter: "tablesorter-filter",
filter_hideFilters: false,
filter_functions: {
3: {
"Midlands+North": function(f) {
return f === "Midlands" | f === "North";
},
"Scotland+NI": function(f) {
return f === "Scotland" | f === "N.Ireland";
},
"South+East": function(f) {
return f === "South" | f === "East";
},
"Wales+West": function(f) {
return f === "Wales" | f === "West";
},
"Mid+Nor+Sco+NI": function(f) {
return f === "Midlands" | f === "North" | f === "Scotland" | f === "N.Ireland";
},
"Sou+Eas+Wal+Wes": function(f) {
return f === "South" | f === "East" | f === "Wales" | f === "West";
}
}
}
}
});
});
function alarms() {
$("table tbody").load("includes/alarmsResults.php", function() {
$("table").trigger("update");
});
}
window.setInterval(alarms, 10000);
alarmsResults.php just runs an sql query and returns the results in <tr><td> tags.
IE8 works fine with the plugins if the data is static but after an update filter and zebra stop working. Any ideas please?
I have tried with tableSorter 2.1 widgets - updated 4/2/2012 and the old filter and it works but it does not have the custom filter options.
Cheers.