lorenzofox3 / Smart-Table

Code source of Smart Table module: a table/grid for Angularjs
http://lorenzofox3.github.io/smart-table-website/
1.8k stars 513 forks source link

smart table not sorting numbers and letters #743

Closed bouchra90 closed 7 years ago

bouchra90 commented 7 years ago

Hi everyone, Am facing a big problem and i have searched in almost all the issues about smart table and sorting without finding any solution. My problem is that i want to sort titles like: APOLLO HOSPITAL 19 MAYIS 24H Test A CARDARELLI A.O. S. MARIA DELLA ZUYDERLAND ZITHAKLINIK S.A The librairy sorts the whole liste (more then 1000000 items) but not properly, it does not handle numbers, when i sort desc i dont see any string starting with Z, it's like nothing happened, and with the asc sorting i get for example: APOLLO HOSPITAL 19 MAYIS 24H Test A CARDARELLI A.O. S. MARIA DELLA ZUYDERLAND ZITHAKLINIK S.A please can anyone help me? i guess this kind of sorting (numbers and letters) missing is missing in the librairy. Thanks

MrWook commented 7 years ago

Hello @bouchra90,

As your can see in this example Plunker the sorting works just fine. A number is a character that will be sorted before the "A".

I think you have a bug in your data request, better check there.

If you want to use a custom sorting, this topic was answered by @lorenzofox3 in this issue topic #392

bouchra90 commented 7 years ago

Thank you @MrWook for the reply i'll check it right now.

bouchra90 commented 7 years ago

emmm, i don't know seriously this is so confusing, my data is stored in tha database in a verry basic way and i get it with a select request, i mean i don't do any kind of processing or anything before showing it, i have REST that gets my data from the database and i show it on the frontside, all i want to do then is to be able of sorting it asc and desc.

bouchra90 commented 7 years ago

Am gonna close this issue because i found that the st-sort didn't match with name of the column, i didnt pay attention that it has been changed to another name :nerd_face: