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

[DataGrid] onColumnVisibilityChange doesn't fire when using show all columns #2506

Closed
2 tasks done
lovesinatra opened this issue Aug 30, 2021 · 2 comments
Closed
2 tasks done
Labels
bug 🐛 Something doesn't work component: data grid This is the name of the generic UI component, not the React module!

Comments

@lovesinatra
Copy link

lovesinatra commented Aug 30, 2021

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Current Behavior 😯

When clicking on "show all" from the columns menu the onColumnVisibilityChange event doesn't fire off

showall
__

Expected Behavior 🤔

onColumnVisibilityChange should be called

Steps to Reproduce 🕹

Steps:

Context 🔦

I'm trying to persist column changes using this event handler

Order id 💳

27855

@lovesinatra lovesinatra added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Aug 30, 2021
@lovesinatra lovesinatra reopened this Aug 30, 2021
@joserodolfofreitas joserodolfofreitas added bug 🐛 Something doesn't work component: data grid This is the name of the generic UI component, not the React module! feature: Other and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Feb 16, 2022
@joserodolfofreitas
Copy link
Member

I'm reopening the issue because it's indeed expected that the callback is called when clicking "show all" or "hide all".
for reproduction, please check the codesandbox example.

@joserodolfofreitas joserodolfofreitas changed the title onColumnVisibilityChange doesn't fire when using show all columns [DataGrid] onColumnVisibilityChange doesn't fire when using show all columns Feb 16, 2022
@flaviendelangle
Copy link
Member

Duplicated #2198

See the conversation for context
We won't fix this callback which is not compatible with a batched visibility switch since it takes a single ID as an argument.
But we introduced a new onColumnVisibilityModelChange which contains all the information necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work component: data grid This is the name of the generic UI component, not the React module!
Projects
None yet
Development

No branches or pull requests

3 participants