gregnb / gregnb/mui-datatables

Programatically apply filters to table on table init.

Open
#1,622 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
2.7k
Forks
906
PR merge metrics
No merged PRs in 30d

Description

I have server side filters enabled in my grid and one of the requirements I have, is to persist the grid settings (filters, sort, order etc) in the browser. I have not been able to figure out a clean way, where I can programatically retrive the filter settings from the browser's local storage and then apply them to the grid. I know that there is a filterList option for indivisual columns but this is not usefull as I am trying to make the grid as generic as possible and the columns-and configurations are being passed to the grid from the parent.
I know, one of the solution could be to go to the parent component and retrive filterList and change the columns config there but this doesnot seems to be a good solution as I will have to do this over and over for all the different types of grids. I would want to have a general fucntion inside the grid (child) where I can dynamically retrive and apply filters for any grid id/type.

Any help would be appreciated,

Thanks

## Expected Behavior

I would ideally want a way where I can apply the filters programatically so that I donot have to take care of filters all different types of grids and their columns.

## Your Environment

| Tech | Version |
|--------------|---------|
| Material-UI | |
| MUI-datatables | 3.4^ |
| React | 16.0^ |
| browser | |
| etc | |

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.