Material-table: Close an expanded detailPanel

Created on 10 Sep 2020  路  2Comments  路  Source: mbrn/material-table

How to close an expanded detailPanel when I click the button on it

detailPanel = {
    [
        rowData => ({
            icon: "chevron_left",
            openIcon: "expand_more",
            render: () =>
                <div onClick={() => closeExpandedPanel()}>
                    {rowData.nameObject}
                </div>,
        }),
        ]
      }
question wontfix

Most helpful comment

in the onClick method, insert this ; it will toggle the detail panel linked to your row :

tableRef.current.onToggleDetailPanel([rowData.tableData.id], tableRef.current.props.detailPanel)

All 2 comments

in the onClick method, insert this ; it will toggle the detail panel linked to your row :

tableRef.current.onToggleDetailPanel([rowData.tableData.id], tableRef.current.props.detailPanel)

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. You can reopen it if it required.

Was this page helpful?
0 / 5 - 0 ratings