I am using the DataTables jQuery plugin. I am trying to enable sort interaction, but when sorting it sorts alphabetically and not numerically. As you can see in the enclosed pic
Updated answer
With the latest version of DataTables you need to set the type
property of the object you provide in the columnDefs
array, like this:
$('#example').dataTable({
"columnDefs": [
{ "type": "num" }
]
});
Note that there are many other methods of sorting which can be found in the documentation
Original answer
You need to add the sType
parameter to your column definition.
For example:
$('#example').dataTable({
"aoColumnDefs": [
{ "sType": "numeric" }
]
});
More information in the DataTable documentation: http://www.datatables.net/plug-ins/sorting