Sorting on column which contains numbers and "Unlimited" text
Sorting on column which contains numbers and "Unlimited" text

I have a datatable which has sortable column containing stock numbers, a few rows contain the word "Unlimited" and this stops the sorting working correctly.
I have read a number of posts on this forum and the suggestions are sType (which looks like it might be from an old version) and natural sorting (?)
How can I make this column sort the numbers with "Unlimited" cells the highest sortable number?
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
For reference: http://live.datatables.net/bezahepi/1/
Using
columns.type
won't help since you have two different data types in one column. You can use Orthogonal Data for this. Usecolumns.render
similar to the documentation example. You will need to set both thesort
value and thetype
value so that the column type is set to numeric. Here is the update example:http://live.datatables.net/bezahepi/2/edit
Kevin
Yep brilliant - thanks