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] apiRef.current.getRowId is not a function when using row spanning and row grouping together (we have support key for premium version). #16413

Open
Anupheaus opened this issue Jan 31, 2025 · 4 comments · May be fixed by #16487
Assignees
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

Comments

@Anupheaus
Copy link

Anupheaus commented Jan 31, 2025

Steps to reproduce

Cannot provide link to live example.

Can provide stack trace (I've added the relative paths manually):
Uncaught TypeError: apiRef.current.getRowId is not a function
at valueGetter (/hooks/features/rowGrouping/createGroupingColDef.js:233:36)
at getCellValue (/hooks/features/rows/gridRowSpanningUtils.js:39:17)
at /hooks/features/rows/useGridRowSpanning.js:44:25
at Array.forEach ()
at computeRowSpanningState (/hooks/features/rows/useGridRowSpanning.js:35:11)
at rowSpanningStateInitializer (/hooks/features/rows/useGridRowSpanning.js:157:9)
at useGridInitializeState (/hooks/utils/useGridInitializeState.js:5:35)
at useDataGridPremiumComponent (/DataGridPremium/useDataGridPremiumComponent.js:52:3)
at DataGridPremium (/DataGridPremium/DataGridPremium.js:29:25)
at renderWithHooks (react-dom.development.js:15486:18)

Current behavior

When I create a row spannable data grid (using unstable_rowSpanning) and then add a rowGrouping model into the intialState, one of the first function calls is to valueGetter, which then tries to get the row id using apiRef.current.getRowId, but this function is not defined, even if I add it as a prop to the main props of the data grid (getRowId).

Expected behavior

This should not error when using row spanning and row grouping.

Context

No response

Your environment

npx @mui/envinfo
Tested using Chrome

System:
    OS: macOS 15.2
  Binaries:
    Node: 20.18.2 - ~/.nvm/versions/node/v20.18.2/bin/node
    npm: 10.8.2 - ~/.nvm/versions/node/v20.18.2/bin/npm
    pnpm: Not Found
  Browsers:
    Chrome: 131.0.6778.265
    Edge: Not Found
    Safari: 18.2
  npmPackages:
    @emotion/react: ^11.14.0 => 11.14.0 
    @emotion/styled: ^11.14.0 => 11.14.0 
    @mui/core-downloads-tracker:  6.4.2 
    @mui/icons-material: ^6.4.2 => 6.4.2 
    @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.24.1 
    @mui/x-data-grid-premium: ^7.24.1 => 7.24.1 
    @mui/x-data-grid-pro:  7.24.1 
    @mui/x-date-pickers:  7.24.1 
    @mui/x-date-pickers-pro: ^7.24.1 => 7.24.1 
    @mui/x-internals:  7.24.1 
    @mui/x-license: ^7.24.1 => 7.24.1 
    @types/react: ^18.2.66 => 18.3.3 
    react: ^18.2.0 => 18.3.1 
    react-dom: ^18.2.0 => 18.3.1 
    styled-components:  6.1.11 
    typescript: ^5.2.2 => 5.4.5

Search keywords: getRowId not function row spanning grouping

@Anupheaus Anupheaus added bug 🐛 Something doesn't work status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Jan 31, 2025
@github-actions github-actions bot changed the title [data-grid] apiRef.current.getRowId is not a function when using row spanning and row grouping. [data grid] apiRef.current.getRowId is not a function when using row spanning and row grouping. Jan 31, 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 31, 2025
@Anupheaus Anupheaus changed the title [data grid] apiRef.current.getRowId is not a function when using row spanning and row grouping. [data grid] apiRef.current.getRowId is not a function when using row spanning and row grouping together (we have support key for premium version). Jan 31, 2025
@MBilalShafi
Copy link
Member

Thank you for reporting, it's a known one and a similar one has already been reported in #16103, and should be fixed soon.

@MBilalShafi MBilalShafi added 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 Feb 2, 2025
@MBilalShafi MBilalShafi self-assigned this Feb 2, 2025
@gabgagnon
Copy link

We have the same issue on our side. This bug is blocking us from releasing our new tables to the client for the expected date in february. @MBilalShafi Thank you for working on it, really appreciated.

@Anupheaus
Copy link
Author

Not trying to be difficult or a pain, but I've been asked to see if I can find out from you what kind of timescale "soon" might be please? Are we talking this week, this month or this quarter please?

@MBilalShafi
Copy link
Member

@Anupheaus I've just raised a potential fix, hoping to have it released this week or next week.

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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants