-
Notifications
You must be signed in to change notification settings - Fork 1k
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
TreeTable: sortFunction is not called when custom sort is used #6115
Comments
Duplicate of: #6083 but leaving this one open and closing that one because yours contains a reproducer and the other ticket does not. |
You need to pass 'custom' as a sortable prop to make it work: BUT |
Oh, I see there's been a change recently here https://github.com/primefaces/primereact/blob/master/components/lib/treetable/TreeTable.js#L227 so |
@MBelniak so its all working? |
I believe the problem with custom sort function not being called for column with default sorting is still there. I'm checking right now. It might be it's a one liner change with setting a default value for columnField ref |
@melloware I can confirm that custom sortFunction is not called when sortMode is 'multiple'. The function sortMultipleNodes is called in such case and it does not care about custom sortFunction |
Okay, the fix for default sorting with custom sortFunction will not be so simple. The TreeTableHeader needs to pass info about sortFunction and sortable props of Column to state of TreeTable in order to reference them in onSort. I will investigate further later. |
Turned out to be not so difficult, PR: #6436 |
Describe the bug
The column's custom sort function is not called when sorting a column.
Reproducer
https://stackblitz.com/edit/vqw5gi-jmmcd5?file=src%2FApp.jsx
PrimeReact version
10.3.1
React version
17.x
Language
TypeScript
Build / Runtime
Create React App (CRA)
Browser(s)
No response
Steps to reproduce the behavior
No response
Expected behavior
The multi sort mode should allow users to customize the sort of a column.
The text was updated successfully, but these errors were encountered: