-
Notifications
You must be signed in to change notification settings - Fork 380
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
Sorting on columns that aren't text doesn't seem to work correctly #880
Comments
Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible. |
Can confirm this issue as well. Sorting with column values that are numeric seems to be treated as strings instead which then fails to produce the correct order. Here are some screenshots for both ascending and descending sorts of numeric columns failing to produce the correct order. An override function for sorting in the IViewField definition is a very good compromise as well. |
Thank you @scallin for reporting this one. But, anyway, I've added a new prop sortItems?: (items: any[], columnName: string, descending: boolean) => any[]; It will be included in the next |
@AJIXuMuK many thanks for the quick response on this issue. but any chance this could be applied to Cheers~ |
@HeShallNot - did you check that you provide numbers as field values, not strings? We can add this to |
@AJIXuMuK if it's possible It will be great if you will add this fix to v1 I'm working with on prem and I just come across this problem now that my listView control sorting alphabetic |
Category
[ ] Enhancement
[ ] Bug
[X] Question
Version
Please specify what version of the library you are using: [ 1.19.0 ]
Expected / Desired Behavior / Question
Is there a way to override the default sorting functionality? Sorting is built in, but treats all content as text, so number columns (like item ID) and date columns do not sort correctly.
Observed Behavior
If I add ListView with list items and a column to show the ID of the list items like this:
const viewFields: IViewField[] = [
{
name: 'ID',
minWidth: 80,
maxWidth: 90,
isResizable: true,
displayName: 'ID',
sorting: true,
}
]
Clicking on the column will sort the items like this:
1
10
100
14
15
2
20
etc.
Steps to Reproduce
Steps are provided above.
Thanks!
The text was updated successfully, but these errors were encountered: