jQuery tablesorter textExtraction functionality for dataTables?
jQuery tablesorter textExtraction functionality for dataTables?
PatrikH
Posts: 1Questions: 0Answers: 0
Hi. I'm currently trying to do a switch from tablesorter to dataTables on one of my sites. I have found that dataTables is far superior when it comes to handling large amounts of data, plus the pagination is excellent!
I have however run in to a small problem. By default dataTables uses the value of the first child of the for the sorting of a column (node.childNodes[0].innerHTML). I need it to apply sorting based on the value of the second child node instead (node.childNodes[1].innerHTML), and sometimes the second child nodes first child (node.childNodes[1].childNodes[0].innerHTML), etc.
With tablesorter i can easily specify this by calling a function for the attribute "textExtraction:" ( tablesorter({textExtraction:myFunc}) ).
But i'm at a loss as to how i can accomplish the same thing with dataTables.
Any help would be greatly appreciated!
I have however run in to a small problem. By default dataTables uses the value of the first child of the for the sorting of a column (node.childNodes[0].innerHTML). I need it to apply sorting based on the value of the second child node instead (node.childNodes[1].innerHTML), and sometimes the second child nodes first child (node.childNodes[1].childNodes[0].innerHTML), etc.
With tablesorter i can easily specify this by calling a function for the attribute "textExtraction:" ( tablesorter({textExtraction:myFunc}) ).
But i'm at a loss as to how i can accomplish the same thing with dataTables.
Any help would be greatly appreciated!
This discussion has been closed.