How to sort on this column?
How to sort on this column?
Hi, how do I make sure Datatables use the correct price for sorting?
I want to sort on the 6.99 price. Tried with a mData function with no luck.
[code]
£6.99
€8.18
[/code]
[code]$('#table').dataTable({
"aoColumns": [
{ "mData": function ( source, type, val ) {
// what do to here? i dont want to change the display, only the value datatable is sorting on
return source;
}}
]
});
[/code]
I want to sort on the 6.99 price. Tried with a mData function with no luck.
[code]
£6.99
€8.18
[/code]
[code]$('#table').dataTable({
"aoColumns": [
{ "mData": function ( source, type, val ) {
// what do to here? i dont want to change the display, only the value datatable is sorting on
return source;
}}
]
});
[/code]
This discussion has been closed.
Replies
There are a number of sorting plug-ins already valuable here which you might be able to use as a template: http://datatables.net/plug-ins/sorting
Allan
Is there a way to select the innerHTML of a specific domElement and pass it to the sorting plug-in? Like my [code]$10[/code] example.