Skip to content
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

Fix #6083 TreeTable onSort #6587

Closed

Conversation

KirilCycle
Copy link
Contributor

Defect Fixes

Fix #6083

Apply sortField and sortOrder properties only during the first rendering

Copy link

vercel bot commented May 7, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

2 Ignored Deployments
Name Status Preview Comments Updated (UTC)
primereact ⬜️ Ignored (Inspect) Visit Preview May 7, 2024 5:54pm
primereact-v9 ⬜️ Ignored (Inspect) Visit Preview May 7, 2024 5:54pm

@melloware
Copy link
Member

Hmm I am not sure this is correct. Did you look at DataTable? I feel like this was done on purpose if the user is using props.onSort they are controlling the sort so props.sort is applied else the internal sortState is used if PrimeReact is controlling the sort not the user.

@KirilCycle
Copy link
Contributor Author

KirilCycle commented May 7, 2024

Hmm I am not sure this is correct. Did you look at DataTable? I feel like this was done on purpose if the user is using props.onSort they are controlling the sort so props.sort is applied else the internal sortState is used if PrimeReact is controlling the sort not the user.

Yes, I see what you mean, let me take a look at the DataTable

@KirilCycle
Copy link
Contributor Author

Yes, you are right, DataTable behaves the same way as TreeTable, you need to manually control "sortField" and "sortOrder" to make it work. This approach is more flexible, but not as clear. I saw that primevue works similarly to this PR, even with onScroll it will work, but there is no way to control these parameters externally, does it make sense to control them externally?

@melloware
Copy link
Member

Its the way its always been designed for right or wrong so I would leave it.

@KirilCycle KirilCycle closed this May 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TreeTable: Custom sorting (for example from an API) needs better docs
2 participants