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

I'll like to be able to expand sub table for more than one column. (given that a row can only have one expanded sub table) #10127

Closed
2 tasks done
PatriceLoos opened this issue Aug 24, 2023 · 2 comments
Labels
component: data grid This is the name of the generic UI component, not the React module! status: waiting for author Issue with insufficient information

Comments

@PatriceLoos
Copy link

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Summary 💡

I notice that only one column can be expanded in a given table, would it be possible to extend this functionality to multiple column?
image

Examples 🌈

to work around the problem

I can change the content of the extended table [ in the demo (see function DetailPanelContent) ]

<DataGridPro density="compact" columns={[ { field: 'name', headerName: selectedColumn, flex: 1 }, { field: 'quantity', headerName: 'Quantity', align: 'center', type: 'number', }, { field: 'unitPrice', headerName: 'Unit Price', type: 'number' }, { field: 'total', headerName: 'Total', type: 'number', valueGetter: ({ row }) => row.quantity * row.unitPrice, }, ]} rows={rowProp[selectedColumn as keyof object]} // here I can choose what data will be in the sub table... sx={{ flex: 1 }} hideFooter />

            but I cant trigger the expand action without a click, 
            
            Is there a function I can call to trigger the expand, I tried calling functions:
            apiRef.current.setRowChildrenExpansion(id)
            and 
            apiRef.current.setExpandedDetailPanels([id])
            where apiRef = useGridApiContext();

but it didn't work,

Thank you

Motivation 🔦

showing more information from one table

Order ID 💳 (optional)

No response

@PatriceLoos PatriceLoos added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Aug 24, 2023
@zannager zannager added the component: data grid This is the name of the generic UI component, not the React module! label Aug 24, 2023
@MBilalShafi
Copy link
Member

MBilalShafi commented Aug 28, 2023

Could you provide a minimal reproduction test case with the latest version? This would help identify the request better. 👷
A live example would be perfect. This codesandbox.io template may be a good starting point. Thank you!

@MBilalShafi MBilalShafi added status: waiting for author Issue with insufficient information and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Aug 28, 2023
@github-actions
Copy link

github-actions bot commented Sep 4, 2023

The issue has been inactive for 7 days and has been automatically closed. If you think that it has been incorrectly closed, please reopen it and provide missing information (if any) or continue the last discussion.

@github-actions github-actions bot closed this as completed Sep 4, 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! status: waiting for author Issue with insufficient information
Projects
None yet
Development

No branches or pull requests

3 participants