The issue I am having is probably due to ignorance of how jquery works, but I'll be brave and ask anyway.
I'm using tablesorter on a couple tables that are instantiated through an ajax call. a div container is faded out, populated with the tables, and faded back in.
here is the ajax call
$.ajax({
url: "url",
type: "GET",
cache: false,
data: 'cmd=scriptcmd',
datatype: 'html',
success: function(data)
{
$("#middle").fadeOut('slow',function(){
$("#middle").html(data);
$("table").tablesorter({
widgets: ['zebra'],
sortList: [[3,0]]});
}).fadeIn('slow');
}
});
All of that works fine
Tablesorter sorts the tables and zebras them during the fadeOut callback.
Sorting is working cleanly with the fadeOut callback but not the zebra widget. clicking on a column to sort by triggers the zebra widget and it works fine then.
I notice if I call tablesorter with setTimeout, even with a 1 millisecond timer it works fine, but this is jumpy on screen and I find this very hacky.
Anyone care to demonstrate the correct way? Thanks in advance guys