I am attempting to add in some table sorting using the jquery tablesorter plugin to a Rally app using dojo, struggling with how to hook up the update callback for the tablesorter.
I have html that looks like this (thead and tbody are separated as they are being dynamically generated i.e. number of columns is not known in advance):
tablesorter init is here
function onLoad() {
var appCustom = new ReleaseScopeChange();
appCustom.display(dojo.body());
}
rally.addOnLoad(onLoad);
$(document).ready(function(){$("#myTable").tablesorter();});
Code updating the thead/tbody
dojo.byId("sort-head").innerHTML = headresults;
dojo.byId("sort-body").innerHTML = bodyresults;
$('#myTable').trigger("update");
Now, the sorting never actually gets set up at all. If I add a static table I can get the sorting working perfectly, so I am assuming its related to timing between the ajax request and the update trigger.
I have looked through a lot of other answers on this and I'm really not sure what is missing.