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_group_by_columns_group__ should be an exported value #14470

Open
Tracked by #9328
jmeinerz opened this issue Sep 3, 2024 · 3 comments
Open
Tracked by #9328
Labels
component: data grid This is the name of the generic UI component, not the React module! docs Improvements or additions to the documentation feature: Row grouping Related to the data grid Row grouping feature plan: Premium Impact at least one Premium user recipe

Comments

@jmeinerz
Copy link

jmeinerz commented Sep 3, 2024

Steps to reproduce

Link to live example: Not applicable

This is a development experience bug, not a user-facing one.

Current behavior

When using @mui/x-data-grid-premium, MUI creates a new column on a data grid when the defines a custom grouping.

That new column is filterable, and the filter's field is defined as __row_group_by_columns_group__. This string is not exported, and that makes it for a brittle developer experience. Updating MUI might silently break things.

Expected behavior

I want to be able to import a value special-cased by MUI for the column created by a user's grouping, so that I can handle it accordingly in my consuming application.

I want the application to exit fast and be explicit in case a MUI version bump makes my assumptions incorrect.

Context

No response

Your environment

Not applicable

Search keywords: row_group_by_columns_group group by filters

Search keywords:

@jmeinerz jmeinerz added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Sep 3, 2024
@mnajdova mnajdova transferred this issue from mui/material-ui Sep 3, 2024
@flaviendelangle
Copy link
Member

flaviendelangle commented Sep 4, 2024

Hi,
Thanks for your feedback

It is exported in the GRID_ROW_GROUPING_SINGLE_GROUPING_FIELD variable.
If you are using multiple grouping criteria, you can check the getRowGroupingFieldFromGroupingCriteria method.

@michelengelen if you want to double check 🙏
This might not be properly documented.

@flaviendelangle flaviendelangle changed the title __row_group_by_columns_group__ should be an exported value [data grid] __row_group_by_columns_group__ should be an exported value Sep 4, 2024
@flaviendelangle flaviendelangle added plan: Premium Impact at least one Premium user feature: Row grouping Related to the data grid Row grouping feature component: data grid This is the name of the generic UI component, not the React module! labels Sep 4, 2024
@jmeinerz
Copy link
Author

jmeinerz commented Sep 4, 2024

Thank you, @flaviendelangle ! I can confirm the variable does solve the issue. I'm sorry I didn't find it before opening this. Cheers :)

@michelengelen
Copy link
Member

@flaviendelangle you are right ... this specific part is not well documented. I'll add this as a recipe issue to add an example for this. Thanks for pointing that out! 👍🏼

@michelengelen michelengelen added docs Improvements or additions to the documentation recipe and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Sep 4, 2024
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! docs Improvements or additions to the documentation feature: Row grouping Related to the data grid Row grouping feature plan: Premium Impact at least one Premium user recipe
Projects
None yet
Development

No branches or pull requests

3 participants