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

[data grid] aggregationModel does not show noRowsLabel if no rows are provided #16453

Closed
yoshegg opened this issue Feb 4, 2025 · 3 comments · Fixed by #16466
Closed

[data grid] aggregationModel does not show noRowsLabel if no rows are provided #16453

yoshegg opened this issue Feb 4, 2025 · 3 comments · Fixed by #16466
Labels
component: data grid This is the name of the generic UI component, not the React module! feature: Aggregation Related to the data grid Aggregation feature regression A bug, but worse support: premium standard Support request from a Premium standard plan user. https://mui.com/legal/technical-support-sla/

Comments

@yoshegg
Copy link

yoshegg commented Feb 4, 2025

Steps to reproduce

  1. Open this link to live example: https://codesandbox.io/p/sandbox/aggregationmodel-norowslabel-96sfdg?from-embed=&workspaceId=ws_12jL538MCCJzkRwuZb5qo3
    • Two DataGrids are being shown. First one has aggregation, second does not. Only the second shows the noRowsLabel "No rows"
  2. Press "Add row" button
    • Both tables now show a row, the first one also shows a summary row.
  3. Press "Remove row" button
    • Both tables are empty again, but only the second shows "No rows"

Current behavior

cf. "Steps to reproduce"

Expected behavior

The DataGrid with aggregationModel should also show "No rows".

Context

The error can be bypassed by checking if rows exist and only then set the aggregationModel to a filled object. Otherwise it must be an empty object (but not undefined!)

Check line 28 in the example: an alternative to the aggregationModel prop.

Your environment

npx @mui/envinfo
System:
    OS: macOS 14.7.3
  Binaries:
    Node: 22.12.0 - ~/.nvm/versions/node/v22.12.0/bin/node
    npm: 10.9.0 - ~/.nvm/versions/node/v22.12.0/bin/npm
    pnpm: Not Found
  Browsers:
    Chrome: 132.0.6834.160
    Edge: Not Found
    Safari: 17.6
  npmPackages:
    @emotion/react: 11.14.0 => 11.14.0 
    @emotion/styled: 11.14.0 => 11.14.0 
    @mui/base:  5.0.0-beta.42 
    @mui/core-downloads-tracker:  6.4.2 
    @mui/icons-material: 6.4.2 => 6.4.2 
    @mui/joy: 5.0.0-dev.240424162023-9968b4889d => 5.0.0-dev.240424162023-9968b4889d 
    @mui/lab: 6.0.0-dev.240424162023-9968b4889d => 6.0.0-dev.240424162023-9968b4889d 
    @mui/material: 6.4.2 => 6.4.2 
    @mui/private-theming:  6.4.2 
    @mui/styled-engine:  6.4.2 
    @mui/system:  6.4.2 
    @mui/types:  7.2.21 
    @mui/utils:  6.4.2 
    @mui/x-data-grid: 7.25.0 => 7.25.0 
    @mui/x-data-grid-premium: 7.25.0 => 7.25.0 
    @mui/x-data-grid-pro:  7.25.0 
    @mui/x-date-pickers: 7.25.0 => 7.25.0 
    @mui/x-internals:  7.25.0 
    @mui/x-license:  7.25.0 
    @types/react: 18.3.18 => 18.3.18 
    react: 18.3.1 => 18.3.1 
    react-dom: 18.3.1 => 18.3.1 
    typescript:  5.6.3 

Search keywords: DataGrid aggregation noRowsLabel

Order ID: 95669

@yoshegg yoshegg added bug 🐛 Something doesn't work status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Feb 4, 2025
@github-actions github-actions bot added component: data grid This is the name of the generic UI component, not the React module! support: premium standard Support request from a Premium standard plan user. https://mui.com/legal/technical-support-sla/ labels Feb 4, 2025
@db-qc
Copy link

db-qc commented Feb 4, 2025

Hey! I posted in the wrong repo by accident so I didn't see your report.

I also noticed the same issue this morning and have made a ticket here: #16458

@KenanYusuf KenanYusuf changed the title DataGrid with aggregationModel does not show noRowsLabel if no rows are provided [data grid] aggregationModel does not show noRowsLabel if no rows are provided Feb 4, 2025
@KenanYusuf KenanYusuf added the feature: Aggregation Related to the data grid Aggregation feature label Feb 4, 2025
@KenanYusuf KenanYusuf added regression A bug, but worse and removed bug 🐛 Something doesn't work labels Feb 4, 2025
@KenanYusuf
Copy link
Member

Thanks for raising the issue @yoshegg and @db-qc.

Looks like this is a regression introduced in v7.23.2 by this PR #15335

@KenanYusuf KenanYusuf removed the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Feb 4, 2025
@github-project-automation github-project-automation bot moved this to 🆕 Needs refinement in MUI X Data Grid Feb 4, 2025
@KenanYusuf KenanYusuf moved this from 🆕 Needs refinement to 🔖 Ready in MUI X Data Grid Feb 4, 2025
Copy link

github-actions bot commented Feb 5, 2025

This issue has been closed. If you have a similar problem but not exactly the same, please open a new issue.
Now, if you have additional information related to this issue or things that could help future readers, feel free to leave a comment.

Note

@yoshegg How did we do? Your experience with our support team matters to us. If you have a moment, please share your thoughts in this short Support Satisfaction survey.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: data grid This is the name of the generic UI component, not the React module! feature: Aggregation Related to the data grid Aggregation feature regression A bug, but worse support: premium standard Support request from a Premium standard plan user. https://mui.com/legal/technical-support-sla/
Projects
Status: 🔖 Ready
Development

Successfully merging a pull request may close this issue.

3 participants