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/
3.91k stars 1.19k forks source link

[data grid] Save and restore filtermodels #13430

Open pankajindevops opened 3 weeks ago

pankajindevops commented 3 weeks ago

The problem in depth

Hi, I would like to Create a Filter in MUI Pro Data Grid and Save it giving it a name. And reuse a Filter without having to create the same filter again and again. I searched everywhere but couldn't find it therefore wondering if this feature is available ?

Your environment

System: OS: Linux 6.5 Ubuntu 22.04.4 LTS 22.04.4 LTS (Jammy Jellyfish) Binaries: Node: 21.5.0 - /usr/local/bin/node npm: 10.2.4 - /usr/local/bin/npm pnpm: Not Found Browsers: Chrome: 125.0.6422.141 npmPackages: @emotion/react: ^11.11.3 => 11.11.3 @emotion/styled: ^11.11.0 => 11.11.0 @mui/base: 5.0.0-beta.40 @mui/core-downloads-tracker: 5.15.17 @mui/icons-material: ^5.15.3 => 5.15.3 @mui/material: ^5.15.3 => 5.15.17 @mui/private-theming: 5.15.14 @mui/styled-engine: 5.15.14 @mui/system: 5.15.15 @mui/types: 7.2.14 @mui/utils: 5.15.14 @mui/x-data-grid: ^6.18.7 => 6.18.7 @mui/x-data-grid-pro: ^6.18.7 => 6.18.7 @mui/x-license-pro: ^6.10.2 => 6.10.2 @mui/x-tree-view: ^7.4.0 => 7.4.0 @types/react: ^18 => 18.2.47 react: ^18 => 18.2.0 react-dom: ^18 => 18.2.0 typescript: ^5 => 5.3.3

Search keywords: MUI Pro DataGrid, Filter, Save Filter Order ID: 81990

michelengelen commented 2 weeks ago

Hey @pankajindevops Thanks for raising an issue. This is currently not a built in feature but certainly possible with some customizations. The specific features you would need to use are controlled filtering and some way to save and restore a filtermodel (e.g. by customizing the filter panel content)

@cherniavskii we could maybe add a recipe for this. WDYT?

github-actions[bot] commented 1 week ago

The issue has been inactive for 7 days and has been automatically closed.

cherniavskii commented 1 week ago

@michelengelen Sure, why not? The demo can be similar to this demo: https://mui.com/x/react-data-grid/state/#restore-the-state-with-apiref