-
Notifications
You must be signed in to change notification settings - Fork 782
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
Natural ordering sorter #4491
Comments
If you are referring to the order the data was loaded in, that is the default behavior of the table if you don't sort it. I'm unsure in what other case you would be referring to there |
And, indeed, if I remove the |
I'm afraid I still don't understand what it is you actually need what circumstances are you not able to get the default sort? Adding any sort to a column will naturally result in it being sorted |
Then we are 2 not understanding the other 😅 I need to sort some columns using natural ordering (Javascript localeCompare()). My assumption is that it's a legit need which would be beneficial to others, so having it built-in would be nice IMO. I don't get your point about "default sort", how is it linked to this need at all, I don't make the link. Even if I sort the original data source using my own logic, it's defined for first time and for a single column, it's not dynamic… So, nevermind, I thought it would be a no brainer, it isn't, I'll stick to my current impl which is fine. |
Yeah I think the challenge here is what you are referring to as natural ordering, which is not a specific term for search. If you are literally referring to language specific string sorting, then that is specific to your usage case and is exactly why tabulator allows the addition of custom sort functions |
It would be nice to have a built-in sorter respecting the natural ordering.
The use case I have in mind is linked to numbers, 1, 2, 3…, 10, 20, 100 (instead of 1, 10, 100, 2, 3…).
Another use case is the management of accented characters.
I went for a custom sorter in the meantime but I guess this would be valuable for many.
Options of this sorter could simply expose
String.prototype.localeCompare()
options.My personal case to showcase the benefit is to display a list of books, having "tome X" for each of them:
The text was updated successfully, but these errors were encountered: