Numeric sorting of formatted numbers problem with server-side processing.

Numeric sorting of formatted numbers problem with server-side processing.

countesscatcountesscat Posts: 21Questions: 7Answers: 0
edited December 2018 in Free community support

Hi! I have a table where a column has different row values like:
8.80 € - 20.23 €
1.27 €
6.50 €
16.25%
.etc

Problem is the sorting. It always sorts it asc and desc just like in the database. :disappointed: The column in the database is varchar(24) for the obvious reason - different units. Column is #9. I have declared columndefs like so:

{"type":"num-fmt","targets":[9]}

How should I make it sort properly? Neither declaring html-num, nor html-num-fmt instead of num-fmt helped because server-side processing is used. I want to see that 16.25% is greater than 1.95 € for example. Could it be changed to show % on top of € values always, too?

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 20,150Questions: 26Answers: 4,736
    Answer ✓

    With server side processing enabled your server script is responsible for sorting. Server side processing disables the client side sorting since the only data available at the client is the page being displayed.

    You will need to update your server script to perform the desired sorting.

    Kevin

  • countesscatcountesscat Posts: 21Questions: 7Answers: 0

    Got it. Will try to do it in php then. Thanks!

This discussion has been closed.