-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[DataGrid] Treedata expand/collapse does not trigger onRowClick-Event #11655
Comments
@GeiOoo I think the onRowClick event is designed for purposes where you interact with the row as a dataset, but not as a visual element. Because we can retrieve the row id and it's data when clicking it from the event. Therefore I think the expansion toggle has an e.preventDefault to avoid it. As it is commonly used for row selection, you probably do not want to select a row when expanding it.. Or open a side layer with detailed information and so on. |
Hey @GeiOoo ... we do have a section on the docs that (kind of) handles this already by subscribing a handler to the The param in this is the node that gets expanded, so you can easily get the rowdata with |
Hehe apparently I still have a lot to learn, thanks @michelengelen for pointing that out :) |
don't worry ... that's a pretty advance use-case! :D |
I think It was added in #3929 |
The issue has been inactive for 7 days and has been automatically closed. If you think that it has been incorrectly closed, please reopen it and provide missing information (if any) or continue the last discussion. |
@michelengelen I reopened it because it was unclear to me if we had to wait for user feedbacks on that one, feel free to re-close it if you want |
How did we do @GeiOoo? |
Steps to reproduce
Video: https://github.com/mui/mui-x/assets/29431488/c4fe3ae8-2661-4640-bde0-b8022c09ce3b
Link to live example: https://stackblitz.com/edit/react-qwvzzk?file=Demo.tsx
Steps:
Current behavior
The collapse/expand button does not trigger the onRowClick event.
Expected behavior
The collapse/expand button should trigger the onRowClickEvent to also react to state changes on this row.
Context
I have to save the current collapsed/expanded state of all grouping rows. This onRowClick event would be a solution for that since there is no separate event listener for state changes of row grouping collapse/expande.
If habe also posted a separate feature request for that: #11654
Your environment
npx @mui/envinfo
Search keywords: datagrid treedata group expand collapse row
The text was updated successfully, but these errors were encountered: