Skip to content

[docs] Add recipe for conditional master-detail panels#22971

Merged
michelengelen merged 1 commit into
mui:masterfrom
michelengelen:recipe/datagrid/19146
Jun 28, 2026
Merged

[docs] Add recipe for conditional master-detail panels#22971
michelengelen merged 1 commit into
mui:masterfrom
michelengelen:recipe/datagrid/19146

Conversation

@michelengelen

Copy link
Copy Markdown
Member

Adds a demo showing that returning null from getDetailPanelContent is sufficient to disable the detail panel toggle for a given row, so no custom toggle column is needed just to hide it for rows without content.

Resolves #19146

@michelengelen michelengelen self-assigned this Jun 26, 2026
@michelengelen michelengelen added docs Improvements or additions to the documentation. scope: data grid Changes related to the data grid. feature: Master-detail Related to the data grid Master-detail feature type: enhancement It’s an improvement, but we can’t make up our mind whether it's a bug fix or a new feature. labels Jun 26, 2026
@code-infra-dashboard

Copy link
Copy Markdown

Deploy preview

Bundle size

Bundle Parsed size Gzip size
@mui/x-data-grid 0B(0.00%) 0B(0.00%)
@mui/x-data-grid-pro 0B(0.00%) 0B(0.00%)
@mui/x-data-grid-premium 0B(0.00%) 0B(0.00%)
@mui/x-charts 0B(0.00%) 0B(0.00%)
@mui/x-charts-pro 0B(0.00%) 0B(0.00%)
@mui/x-charts-premium 0B(0.00%) 0B(0.00%)
@mui/x-date-pickers 0B(0.00%) 0B(0.00%)
@mui/x-date-pickers-pro 0B(0.00%) 0B(0.00%)
@mui/x-tree-view 0B(0.00%) 0B(0.00%)
@mui/x-tree-view-pro 0B(0.00%) 0B(0.00%)
@mui/x-license 0B(0.00%) 0B(0.00%)

Details of bundle changes


Check out the code infra dashboard for more information about this PR.

@MBilalShafi MBilalShafi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good to me — this is a focused docs recipe and it solves #19146 cleanly.

The demo documents the simpler existing path: return null/undefined from getDetailPanelContent() for rows without content, and the built-in toggle disables itself. I checked the deploy preview; rows with notes can expand, rows without notes have disabled toggles, and the rendered panel content is correct.

CI is green and I don't see anything blocking here.

@michelengelen
michelengelen merged commit c5fb79a into mui:master Jun 28, 2026
28 checks passed
@michelengelen
michelengelen deleted the recipe/datagrid/19146 branch June 29, 2026 06:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to the documentation. feature: Master-detail Related to the data grid Master-detail feature scope: data grid Changes related to the data grid. type: enhancement It’s an improvement, but we can’t make up our mind whether it's a bug fix or a new feature.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[data grid] Simplify conditional detail panels

2 participants