Help with tablesorter - sorting one column by content within both input fields and textareas
Hello everyone, this'll be my first post here!
I am trying to make the tablesorter sort one of my table columns by
the content inside input fields and textareas. The content is loaded
dynamically from a php application, and some of the cells contains
input fields and some contains textareas.(it's a language translation
app)
I'm pretty lousy when it comes to javascript, but I use jquery because
it makes things a lot easier, and I need some help with this function
in order to get it to sort by all values. I have changed the
textExtraction function so that it actually seems to extract the
innerHTML from the textareas, and the values from the input fields,
and yes it does sort the values as it should - But it groups input
field values together, and textarea innerHTML together.
So even though it sorts ascending and descending, it puts the input
values first(1,5,6) and the textarea values after(2,3,4) or the other
way around depending on asc or desc, and I want it so sort all
together.(1,2,3,4,5,6)
So there is something wrong with my code, and since I don't really
know javascript that well, it can probably be written in a much better
way.
My current code is:
textExtraction: function(node) {
if (node.childNodes[0].tagName != 'input')
{
txtret = node.childNodes[0].value;
}
else
{
txtret = node.childNodes[0].innerHTML;
}
return txtret;
}