I have table a select box and change event for my AJAX call with tablesorter plugin. It does not seem to apply tablesorter more than once. After AJAX success, the sorter functionalities do not get applied to the newly loaded html elements. Below is an example:
$(document).ready(function() {
$('#policies').dataTable();
$('#PolicyCategory').live('change',function(){
var policy = $('#PolicyCategory').val();
var form_data = {
category_id: policy,
ajax: '1'
};
$.ajax({
url: "http://coverbuddy.favstay.com/users/category_ajax",
type: "POST",
dataType: "html",
cache: false,
data : form_data,
success: function(data){
//console.log();
//alert(data);
$('#policies').html(data);
$("#policies").trigger("update");
}
});
});
});
Is there something that I'm missing?