[data grid] How to get filters value using apiRef? #15696
Labels
component: data grid
This is the name of the generic UI component, not the React module!
customization: logic
Logic customizability
feature: Filtering on header
Related to the header filtering (Pro) feature
status: waiting for author
Issue with insufficient information
Steps to reproduce
Steps:
Current behavior
I am using the premium version of DataGrid and have a header filter with a Select component that allows multiple values. You can find the implementation here: link.
Currently, I am storing the selected values in the state, but the issue is that I have to include this state in the useMemo dependency array, which causes unnecessary re-renders of the component and the useMemo hook.
Is there a way to directly use apiRef to retrieve the selected filter values? I am already using apiRef.current.setFilterModel to apply the filter, so I would like something similar to apiRef.current.getFilterModel to access the current selected values without triggering re-renders.
Expected behavior
No response
Context
No response
Your environment
npx @mui/envinfo
Search keywords: How to get filters value using apiRef?
The text was updated successfully, but these errors were encountered: