-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Default sorting by string values has changed from case-insensitive to case-sensitive #1795
Comments
this was done on purpose, to allow for quicker comparing when you don't get impacted by case. to have it work as previous, attach your own 'default' comparator to the default col def, ie:
|
The snippet from @ceolter above contains a typo ( gridOptions = {
defaultColDef = {
comparator: function(a,b) {
if (typeof a === 'string') {
return a.localeCompare(b);
} else {
return (a > b ? 1 : (a < b ? -1 : 0));
}
}
}
...
} |
|
This was referenced May 13, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm submitting a ...
Current behavior
Currently (after updating from v8 to version v12) sorting rows by string values is by default case-sensitive, so a column with values: "a", "B", and "c", will be sorted as:
Expected behavior
I'm not sure what the specified behavior is, but in version 8 the default string sort was case insensitive, resulting in the following order:
What is the motivation / use case for changing the behavior?
The default sorting behavior seems to have changed. Since I could not find anything about this in the release notes* I thought this might have happened unintentionally.
The change seems to be introduced in this commit, where the default
localeCompare
is replaced with adoQuickCompare
function.Or should the 'accentedSort' be used for case insensitive sort? In which case it would be nice to have this mentioned in the documentation.
* I updated from 8 to 12, so I had to go through quit some release notes and might have missed this.
Please tell us about your environment:
ag-Grid version: 12.0.1
Browser:
All
The text was updated successfully, but these errors were encountered: