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] Row spanning within tree data throws an error on initial load #16103

Open
martinhonza opened this issue Jan 8, 2025 · 1 comment
Labels
bug 🐛 Something doesn't work component: data grid This is the name of the generic UI component, not the React module! feature: Row spanning Related to the data grid Row spanning feature feature: Tree data Related to the data grid Tree data feature

Comments

@martinhonza
Copy link

martinhonza commented Jan 8, 2025

Steps to reproduce

Steps:

  1. Open this link to live example: https://codesandbox.io/p/sandbox/condescending-tesla-9lnzy3?file=%2Fsrc%2FDemo.tsx
  2. It should fail since tree data and row spanning is allowed
  3. If you comment out tree data it should start working, afterwards if you allow tree data and don't refresh it manually it works, but stops working after you refresh the page. So it seems that initial load is problematic.

Current behavior

If I enable treeData with row spanning I get an error apiRef.current.getRowId is not a function

Expected behavior

Tree data should work with row spanning

Context

No response

Your environment

npx @mui/envinfo
  Don't forget to mention which browser you used.
  Output from `npx @mui/envinfo` goes here.

Search keywords: row spanning tree data

Order ID: #54652

@martinhonza martinhonza added bug 🐛 Something doesn't work status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Jan 8, 2025
@github-actions github-actions bot changed the title [DataGrid] Row spanning within tree data throws an error on initial load [data grid] Row spanning within tree data throws an error on initial load Jan 8, 2025
@github-actions github-actions bot added the component: data grid This is the name of the generic UI component, not the React module! label Jan 8, 2025
@michelengelen
Copy link
Member

Hey @martinhonza ... this looks like a race condition, where the grid tries to access a row which is not loaded into the state at that moment. Might be that tree data grouping happens before the rowspanning is complete.

I'll add this to the board 👍🏼

cc @MBilalShafi

@michelengelen michelengelen added feature: Tree data Related to the data grid Tree data feature feature: Row spanning Related to the data grid Row spanning feature and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Jan 9, 2025
@github-project-automation github-project-automation bot moved this to 🆕 Needs refinement in MUI X Data Grid Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work component: data grid This is the name of the generic UI component, not the React module! feature: Row spanning Related to the data grid Row spanning feature feature: Tree data Related to the data grid Tree data feature
Projects
Status: 🆕 Needs refinement
Development

No branches or pull requests

2 participants