You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ASC sort puts A1 in front of A02. That's not the expected result, as 0 < 1. I'm under the impression leading zeros are ignored and in this case it sorts as the values were A1 and A2. My data contains lots of leading zeros mixed with text and getting rid of them is not an option I have.
Is it a bug or a feature? Is there a way to change this behaviour through configuration?
Another related question: Is there a doc page listing all the sorting options (css classes)? I could only find sorter-text and sorter-digit.
Thanks,
Ed
The text was updated successfully, but these errors were encountered:
The internal natural sort algorithm uses chunking to sort a mixture of text and numbers, it does ignore leading zeros. So, if you want to use the built-in JavaScript sorting method, which should behave as you need, then set the textSorter option for that column to use a basic sort method as follows (demo):
On the doc page, you can look under the headers option, which has will redirect you to the config.parsers entry... it should be more obvious, so I'll add a new "built-in parsers" demo with a full list.
I'm guessing this issue has been resolved, so I'm going to close it. If you continue to have problems, please feel free to continue the discussion in this thread.
Hey,
I think I found a problem when sorting columns containing number and letters, just like this example's first column: https://mottie.github.io/tablesorter/docs/example-options-headers-digits-strings.html
ASC sort puts A1 in front of A02. That's not the expected result, as 0 < 1. I'm under the impression leading zeros are ignored and in this case it sorts as the values were A1 and A2. My data contains lots of leading zeros mixed with text and getting rid of them is not an option I have.
Is it a bug or a feature? Is there a way to change this behaviour through configuration?
Another related question: Is there a doc page listing all the sorting options (css classes)? I could only find sorter-text and sorter-digit.
Thanks,
Ed
The text was updated successfully, but these errors were encountered: