Using Datatables when numbers are enclosed in parenthesis
Using Datatables when numbers are enclosed in parenthesis
Hi all,
I am new to Datatables and I'm trying to work out how to use the sort functionality when numbers are enclosed in parenthesis.
As you can see from the last column in my example http://jsfiddle.net/Adam84/q4xawevz/1/ the last column does not display in the correct order when sorted.
I believe the numbers that are enclosed are being read as a string and are therefore being displayed alphanumerically. How do I go about getting them to display numerically instead?
I have tried setting the sType to 'numeric' but to no avail. Any advice or examples would be greatly appreciated.
Thanks,
Adam
This question has an accepted answers - jump to answer
Answers
Spot on! What you would need is a sorting plug-in that will remove the brackets and then sort the numbers numerically. This plug-in would do the trick.
Allan
Hi Allan,
Thanks for the quick response. Can you re-post that plug-in link. It doesn't seem to go anywhere.
Thanks again,
Adam
Oops - sorry. Fixed it above.
Allan