-1

New to React and Material-Table.

I have filters and grouping allowed in my material-table.

How can i save the filters and groups to the local storage and load them?

CoupFlu
  • 311
  • 4
  • 20

1 Answers1

0

you want first to

const newValues= JSON.parse(localStorage.getItem('your local storage))

then add your filter

newValues.filter()

finally

localStorage.setItem('your local storage',JSON.stringify(newValues))
  • Within material-table, there is an “ onGroupRemoved” but nothing for when a group is added. How do you trigger the local storage save when a group is added? – CoupFlu Aug 26 '22 at 23:38