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: Custom sorting (for example from an API) needs better docs #6083
Comments
Duplicate of #6115 which has a reproducer so subscribe to that ticket please. |
@melloware I have checked the other ticket - it's not the same issue. This one is about table-level "onSort" prop, the other one is column-level "sortFunction", and the behavior problem is different. I'll try to put together a reproductor example ASAP. Thanks! |
ok if you add a reproducer i can re-open this one. |
@melloware Added reproductor and more details to description of the issue! Thank you. |
@melloware Hello! Can you assign me please ? |
@SpajicM The TreeTable works fine, you just need to manually connect the states to the TreeTable using the 'sortOrder' and 'sortField' properties: |
@KirilCycle oh, thanks! Is this documented anywhere or I've missed it? TreeTable's main page only explains sortable and sortMode props, while API page for sortOrder says: "Order to sort the data by default.", which sounds like it's only for setting prefered initial order, not that it should be used in combination with onSort function. |
Well, I didn't see it in the documentation, only descriptions of specific props |
I noticed that vueprime TreeTable doesn't need to pass options manually, I think we should modify the current TreeTable to have similar behaviour, as even props description says that 'sortField' and 'sortOrder' should be used at initial render |
Describe the bug
Hi, I'm using onSort function to make an API call for sorting, but when onSort function is used, original icon highlight and toggling between ASC and DESC is lost.
Expected:
Actual:
Reproducer
https://stackblitz.com/edit/vqw5gi-vnizjy?file=src%2FApp.jsx
PrimeReact version
9.5.0
React version
17.x
Language
TypeScript
Build / Runtime
Create React App (CRA)
The text was updated successfully, but these errors were encountered: