alfajango / jquery-dynatable

A more-fun, semantic, alternative to datatables
http://www.dynatable.com
Other
2.77k stars 363 forks source link

Question on how to sort numeric fields with commas not alphanumeric #254

Open hammerva opened 7 years ago

hammerva commented 7 years ago

Good afternoon. Hopefully this question hasn't been answered. If so please direct me to the closed issue. Anyway I have a number of dynatables that contains a dollar amount. Right now I have the format 999,999.99. For some reason when I click on header to sort from the field, it sorts it as if it was alphanumeric. I would assume the commas (and maybe the decimal place) are causing the headaches. Although I read something in documentation about the header determine the type of field. Has anyone been able to figure out a work around for this or how to manually change the jquery.dynatable.js file?

Thanks for any help

Joykiller commented 7 years ago

Theres a bug in this script for sorting, it seems to only count the first int so if you were sorting a list of numbers, from 2 through 100, You would expect 100 to be on the top. However.. It counts 100 as 1, thus is on the bottom.