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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DataGrid] controlled sortModel is not working #598

Closed
2 tasks done
etomanon opened this issue Nov 16, 2020 · 5 comments 路 Fixed by #1035
Closed
2 tasks done

[DataGrid] controlled sortModel is not working #598

etomanon opened this issue Nov 16, 2020 · 5 comments 路 Fixed by #1035
Assignees
Labels
bug 馃悰 Something doesn't work component: data grid This is the name of the generic UI component, not the React module!
Milestone

Comments

@etomanon
Copy link

etomanon commented Nov 16, 2020

  • The issue is present in the latest release.
  • I have searched the issues of this repository and believe that this is not a duplicate.

Current Behavior 馃槸

When you set sortModel as [ ] or undefined from e.g. [{"field":"subject","sort":"desc"}] then the Data Grid keeps the old sortModel instead of removing any previous sort.

Expected Behavior 馃

sortModel should work as controlled state

Tech Version
Material-UI X 4.0.0-alpha.9
@etomanon etomanon added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Nov 16, 2020
@oliviertassinari
Copy link
Member

Related to #190

@oliviertassinari oliviertassinari added bug 馃悰 Something doesn't work component: data grid This is the name of the generic UI component, not the React module! and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Nov 16, 2020
@etomanon
Copy link
Author

etomanon commented Nov 17, 2020

@oliviertassinari Is there any workaround in the free version to set the sortModel ?
I guess you can set it in the paid version with the apiRef ?

@oliviertassinari
Copy link
Member

@etomanon We have started to work on a state prop to allow doing such #533. I'm not sure when it will land.

@oliviertassinari
Copy link
Member

@etomanon Could you provide a reproduction? It would help a lot. Thanks

@oliviertassinari
Copy link
Member

Same issue as #223

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

Successfully merging a pull request may close this issue.

3 participants