mui / mui-x

MUI X: Build complex and data-rich applications using a growing list of advanced React components, like the Data Grid, Date and Time Pickers, Charts, and more!
https://mui.com/x/
4.14k stars 1.29k forks source link

[data grid] slotProps ColumnsManagement is not working #13071

Closed saeonny closed 5 months ago

saeonny commented 5 months ago

The problem in depth

Hello, I am using DataGridPro and I followed the instructions provided in the documentation for column visibility customization (Customize the list of columns in columns management) and disabling actions in the footer (Disable actions in footer).

However, in my project, when I try to utilize the 'columnsManagement' property within 'slotProps', I encounter an error as shown in the following image: image Is this a bug?

Your environment

`npx @mui/envinfo` Browsers: Chrome: Not Found Edge: Chromium (123.0.2420.97) npmPackages: @emotion/react: ^11.11.3 => 11.11.3 @emotion/styled: ^11.11.0 => 11.11.0 @mui/base: 5.0.0-beta.26 @mui/core-downloads-tracker: 5.15.10 @mui/envinfo: ^2.0.17 => 2.0.17 @mui/icons-material: ^5.15.10 => 5.15.11 @mui/lab: ^5.0.0-alpha.155 => 5.0.0-alpha.155 @mui/material: ^5.15.10 => 5.15.10 @mui/private-theming: 5.15.9 @mui/styled-engine: 5.15.9 @mui/system: 5.15.9 @mui/types: 7.2.13 @mui/utils: 5.15.9 @mui/x-charts: 7.3.2 => 7.3.1 @mui/x-data-grid: 6.19.2 @mui/x-data-grid-generator: latest => 6.19.2 @mui/x-data-grid-premium: 6.19.2 @mui/x-data-grid-pro: latest => 6.19.2 @mui/x-date-pickers: ^6.19.4 => 6.19.5 @mui/x-date-pickers-pro: ^6.19.4 => 6.19.5 @mui/x-license-pro: latest => 6.10.2 @types/react: ^18.2.43 => 18.2.43 react: latest => 18.2.0 react-dom: latest => 18.2.0 typescript: ^5.3.3 => 5.3.3

Search keywords: ColumnsManagement Order ID: 83106

saeonny commented 5 months ago

In my project image image

michelengelen commented 5 months ago

Hey @saeonny ... From your envinfo output I can see that you are using v6. We recently changed the name of the slotProp from slotProp.columnsPanel (in v6) to slotProp.columnsManagement (in v7). So since you are looking at the v7 it will show up as columnsManagement. But for your version you would need to use columnsPanel.

Here is the respective page in the v6 docs: Column visibility (v6)

saeonny commented 5 months ago

Thank you so much its fixed by using columnsPanel !

michelengelen commented 5 months ago

Great ... I'll close this then! 👍🏼

github-actions[bot] commented 5 months ago

:warning: 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.

@saeonny: How did we do? Your experience with our support team matters to us. If you have a moment, please share your thoughts in this short Support Satisfaction survey.