-
Notifications
You must be signed in to change notification settings - Fork 34
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
Lowercase and upercase in dropdown box #12
Comments
Having the same issue and came here to look for a fix. |
In case someone else comes across the same issue. The fnDraw() method appears to have code that lets you specify your own sort function via an 'fnSort' property. I wasn't sure where to specify that so I added it to the code. So, at around line 164 I added my own fnSort function. This took care of the sorting issue.
|
Nice solve of problem, but i met another one, when i have column with czech date format (dd.mm.yyyy) its sortet bad too. I trying to modify you code, but you know ... |
tpcrr, there is much simpler way to do same sorting: fnSort: function(a, b) {
return a.toLowerCase().localeCompare(b.toLowerCase());
} |
To enable sorting you can fix the code in ColumnFilterWidged.js. Change if ( widget.hasOwnProperty( 'fnSort' ) ) {
aDistinctOptions.sort( widget.fnSort );
} else {
aDistinctOptions.sort();
} to if ( widget.oColumn.hasOwnProperty( 'fnSort' ) ) {
aDistinctOptions.sort( widget.oColumn.fnSort );
} else {
aDistinctOptions.sort();
} |
Hi, i found problem. When i have informations in table in lower and uper case, uper case sorts first, and lower after it. Can it be somehow repaired?
for example
Box, Car, Zero, ant, glove is in dropdown box, but it have to be ant, Box, Car, glove, Zero
The text was updated successfully, but these errors were encountered: