-
-
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
[DataGridPremium] gridExpandedRowCountSelector showing count for previously applied filters #9178
Comments
Hey @tielushko |
To explain the current behavior - the |
Hi @cherniavskii , thank you for getting back to me so quickly! I use it in my logic that determined how many rows are going to be displayed on the data grid and apply autoHeight property on the data grid or set it within a specific container height. See the issue mentioned here: #8516. In order to resolve my problem, I subscribed to rowExpansion, rowGroupingModelChange and I wanted to subscribe to filterModelChange for when the number of rows is below a certain max threshold, we can apply the autoHeight property on the grid. is there an event that I can subscribe to that will give me the number of filtered rows after the filtering process was done? I was just under the impression that the selector will work since the documentation mentioned it's applied after the filtering process. Thanks! |
Internally we have the
What we want to mean is that the returned rows are those that survived the filtering process, not that the selector will react to model changes. |
I'll look into it later to see how we can support |
@m4theushw Thank you for your suggestion. I will use it in my code right away. @cherniavskii, I think that would be such an amazing addition to the data grid!!! autoHeight up to a certain max threshold is a must for my customer, and if it could be controlled through passing props, that would be awesome. |
@m4theushw setTimeout functionality is not ideal because the autoHeight property is still applied, meaning it will attempt to draw all of my rows first, then setState will be triggered for the autoHeight. I will try to provide an example of what I mean soon |
Hey @tielushko |
@cherniavskii, this would be a good place to start. It's exactly the concept I was looking for. However, it would be a very nice feature to add the dynamic data grid heights, besides just the numeric ones. For example for our use cases we use vh as the container height. I had a rough approximation formula to use with client height, vh value, and the row height in px from rowHeight prop to determine when to apply autoHeight. I like the virtual scroller event subscription you used there, I think that's something I should have used in my case instead of hitting all the different methods for grouping, filtering, row expansion. Overall, I think your example for autoHeight works really well. |
This issue has been closed. If you have a similar problem but not exactly the same, please open a new issue. Note We value your feedback @tielushko! How was your experience with our support team? |
Steps to reproduce 🕹
Link to live example: https://codesandbox.io/s/gridexpandedrowcountselector-showing-old-filter-count-ytlugm
Steps:
Current behavior 😯
gridExpandedRowCountSelector stores the count when the previous filter model applied to the data grid rows
Expected behavior 🤔
I expect the gridExpandedRowCountSelector to show the count of filtered rows after the filters were applied. I understand that there's a debounce happening before the model changed and the filter got implemented, however then the count of rows should change accordingly as it does with the footer.
Context 🔦
No response
Your environment 🌎
npx @mui/envinfo
Order ID or Support key 💳 (optional)
62502
The text was updated successfully, but these errors were encountered: