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

[DataGridPro] Add new option hideDescendantCount to Tree Data #3368

Merged
merged 4 commits into from
Dec 8, 2021

Conversation

flaviendelangle
Copy link
Member

@flaviendelangle flaviendelangle commented Dec 7, 2021

Extracted from #3277

Will be properly documented and tested in the docs of the grouping columns, I don't think it's worth creating an example for the Tree Data.

@@ -1,5 +1,4 @@
/// <reference types="next" />
/// <reference types="next/types/global" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you know what caused this modification?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#3343

Probably this one
I checked the NextJS example and they have this line

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


const commonProperties: Omit<GridColDef, 'field' | 'editable'> = {
...GRID_TREE_DATA_GROUP_COL_DEF,
renderCell: (params) => (
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you not hideDescendantCount to the colDef and use this parameter in the <GridTreeDataGroupingCell /> component like colDef.valueOptions for <GridEditSingleSelectCell />?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wanted to avoid adding properties on the colDef that are only useful for the grouping column.
But if the team feels like it's better to pass it to the colDef then I just have to move hideDescendantCount from GridGroupingColDefOverride to GridColDef and access it through the colDefprop in the cell component.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sense, but when defining groupingColDef developers will probably expect their props to be in the colDef

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For column grouping I have other properties only usefull for the grouping column.
Putting everything on the colDef is not great I think.

@alexfauquette
Copy link
Member

I agree with you on the doc. The component API should be enough

@flaviendelangle flaviendelangle merged commit 507b1aa into mui:master Dec 8, 2021
@flaviendelangle flaviendelangle deleted the hide-descendant-count branch December 8, 2021 08:13
@zannager zannager added component: data grid This is the name of the generic UI component, not the React module! plan: Pro Impact at least one Pro user labels Jan 17, 2023
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! plan: Pro Impact at least one Pro user
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants