Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82141

jQuery tablesorter textExtraction functionality for dataTables?

$
0
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 <td> 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!

Viewing all articles
Browse latest Browse all 82141

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>