Sorting mixed data types in same column
Sorting mixed data types in same column
Hi,
I have a column in my table that basically shows numeric info (floating numbers). This column comes from a mysql database. But sometimes there is no available data in the database, therefore I show Pending or Waiting strings to the user (as the data will be imported later). When I sort the column, i get the following result: -1.11; -3.54; -13.45; 1.45; 4.54; 6.12; Pending; Pending. So negative values are also sorted in alphabetical order. I tried using aoColumns, setting the column type to numeric, but that didn't do the job.
Could you please help me what else I could try?
Thanks,
Peter
I have a column in my table that basically shows numeric info (floating numbers). This column comes from a mysql database. But sometimes there is no available data in the database, therefore I show Pending or Waiting strings to the user (as the data will be imported later). When I sort the column, i get the following result: -1.11; -3.54; -13.45; 1.45; 4.54; 6.12; Pending; Pending. So negative values are also sorted in alphabetical order. I tried using aoColumns, setting the column type to numeric, but that didn't do the job.
Could you please help me what else I could try?
Thanks,
Peter
This discussion has been closed.
Replies
http://datatables.net/development/sorting
http://datatables.net/plug-ins/sorting
Allan