In my code, I used jQuery table sorter plugin. It works fine until I make an ajax request to dynamically load the table data. I use combined fields to filter the contents of a table using ajax. I read a few posts that said using $("table").trigger("update");could solve my problem. I tried this with my code, but the problem is still there.
Is there any other way to solve this problem? Please help me figure out the solution. I am really stuck badly. Any help would be greatly appreciated. Below is my code:
$(document).ready(function () {
$("#myTable").tablesorter({
widthFixed: true,
widgets: ['zebra'],
headers: {
0: {
sorter: false
}
}
}).tablesorterPager({
container: $("#pager")
});
$("#tag").change(function (event) {
$('#myTable').trigger("update");
$("#myTable").tablesorter();
});
});
Here, the tag is the identifier of the combined field with the name tag, and myTable is the identifier of the table with the plugin for the sorter player.