I'm using tablesorter (http://mottie.github.io/tablesorter/docs/index.html) and one of my tables has a dropdown select box.
With the text extraction below, I managed to make it sort by the option selected. However, this only works on the initial selection. If I change any options and re-sort the table, it still uses the old value.
How can I teach tablesorter to use the currently selected value?
textExtraction: function(node) {
// Check if option selected is set
if ($(node).find('option:selected').text() != "") {
return $(node).find('option:selected').text();
}
// Otherwise return text
else return $(node).text();
}