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

Add prop for column grouping header height #10615

Closed
TimonPeng opened this issue Oct 9, 2023 · 9 comments · Fixed by #14637
Closed

Add prop for column grouping header height #10615

TimonPeng opened this issue Oct 9, 2023 · 9 comments · Fixed by #14637
Assignees
Labels
component: data grid This is the name of the generic UI component, not the React module! customization: css Design CSS customizability feature: Column groups Related to the data grid Column groups feature waiting for 👍 Waiting for upvotes

Comments

@TimonPeng
Copy link

TimonPeng commented Oct 9, 2023

Summary 💡

columnGroupings have fewer data normally so that the height can be smaller, but now the height follows the columnHeaderHeight prop. CSS can't override this dynamically calculated prop either.

Adding a new prop columnGroupingHeaderHeight might be possible to set it separately.

Examples 🌈

No response

Motivation 🔦

No response

Search keywords: column grouping header height

@TimonPeng TimonPeng added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Oct 9, 2023
@romgrk romgrk removed the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Oct 10, 2023
@romgrk
Copy link
Contributor

romgrk commented Oct 10, 2023

Wdym by "can't override the prop"? Have you tried using !important? It's meant for that use-case.

For the feature request itself, we can keep it open but we'll wait to have more interest before prioritizing.

@romgrk romgrk added component: data grid This is the name of the generic UI component, not the React module! waiting for 👍 Waiting for upvotes labels Oct 10, 2023
@TimonPeng
Copy link
Author

Wdym by "can't override the prop"? Have you tried using !important? It's meant for that use-case.

For the feature request itself, we can keep it open but we'll wait to have more interest before prioritizing.

It can be made to barely work by setting the CSS, but since there is logic in the DataGrid that calculates the height, it causes some problems and is an unusable way to go about it.

image

@romgrk
Copy link
Contributor

romgrk commented Oct 12, 2023

Makes sense. Let's keep this open until we have more interest. Also feel free to submit a PR, this shouldn't be too hard to implement.

@omgitsfrancis
Copy link

Ran into this same issue when trying to override the group column header style. I'd be interested in this feature as well.

@pipje2001
Copy link

Same problem here, got it to work for the most part using css. But the filler (MuiDataGrid-filler) calculates the height incorrectly resulting in it being too big.

I set the column group header (first header row) to 3.75rem, and the second to 15rem

Using the columnHeaderHeight prop to set the "average" height of each column header sorta works since this prop only accepts height in px (numbers only) it doesn't work with rem

One thing to note is that using columnHeaderHeight and setting it to the average means that you need to manually specify each column headers height, otherwise it will just take columnHeaderHeight.

It would be nice if the datagrid would dynamically calculate the total headers height.

@burketyler
Copy link

+1 for interest in seeing this implemented. It's something that would be quite useful - i think many designers will want a more compact look for the heading groups, otherwise it can appear a little blocky. Unwilling to go down the CSS fix route given it impacts other height calculations.

@cherniavskii cherniavskii added feature: Column groups Related to the data grid Column groups feature customization: css Design CSS customizability labels Jun 12, 2024
@KenanYusuf KenanYusuf self-assigned this Jul 9, 2024
@rodmaia
Copy link

rodmaia commented Sep 3, 2024

+1

@gepa7
Copy link

gepa7 commented Sep 4, 2024

+1
The height should be content fit in its row.
I use this CSS selector for workaround

.MuiDataGrid-columnHeaders :first-child .MuiDataGrid-columnHeader{
  height: 32px !important;
}

Copy link

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

We value your feedback @TimonPeng! How was your experience with our support team?
If you could spare a moment, we'd love to hear your thoughts in this brief Support Satisfaction survey. Your insights help us improve!

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! customization: css Design CSS customizability feature: Column groups Related to the data grid Column groups feature waiting for 👍 Waiting for upvotes
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

9 participants