Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use locale specific sorting across Slycat #1135

Open
alexsielicki opened this issue Aug 17, 2023 · 2 comments
Open

Use locale specific sorting across Slycat #1135

alexsielicki opened this issue Aug 17, 2023 · 2 comments
Assignees

Comments

@alexsielicki
Copy link
Collaborator

alexsielicki commented Aug 17, 2023

@smartin71 wrote back in April 2022:

A Dial-A-Cluster user was complaining about the sorting in the table when there were strings with numbers. It would sort “Number 1”, “Number 2”, …, “Number 100” as “Number 1”, “Number 10”, “Number 100”, ….

I looked around the internet and found something called localeCompare in JavaScript that can handle this problem and sort as a human would sort when there are numbers in the strings.

https://fuzzytolerance.info/blog/2019/07/19/The-better-way-to-do-natural-sort-in-JavaScript/

I mention this in case it would be something you might want to add to the tables in the other models. (Although I don’t know that anyone else has ever complained about this particular issue.)

This affects many parts of Slycat and we should be consistent with how we sort. I started using localeCompare in the histogram, and @smartin71 is using it in DAC. It should be fairly easy to convert older parts of Slycat to use the same sorting method.

@alexsielicki
Copy link
Collaborator Author

@alexsielicki
Copy link
Collaborator Author

DAC model can use localeSort because it does slickGrid table sorting on the front end. The rest of the models have to rely on table sorting on the server because they can't count on downloading all the table data at once due to potentially very large sizes. So locale specific sorting would need to happen on the server.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant