First of all I would like to thank the author for material-table.
I started playing around with the demos and created a table with custom filtering and live data feed that updates the table. The problem I came across is that it kept resetting the custom filter and there was no way for me to keep the option selected after the table refreshes with new data.
Can anyone help with this? Am I doing something wrong here?
Here is a code sandbox that can with the behavior mentioned above
https://codesandbox.io/s/6jppm0loln
Thank you!
Ehtesham
Hi @ezulfiqar ,
Thanks for making me proud :).
I looked your codesandbox example. You have used columns directly as an array to give table. Table stores filter data on columns. After every refresh it creates columns from zero. So you can move your columns to state.
Look at example that i fixed the problem:
https://codesandbox.io/embed/xj36358myp
Thank you so much for the quick response!
That solves the problem for me. Still new to React so thank you for your patience :)
Most helpful comment
Hi @ezulfiqar ,
Thanks for making me proud :).
I looked your codesandbox example. You have used columns directly as an array to give table. Table stores filter data on columns. After every refresh it creates columns from zero. So you can move your columns to state.
Look at example that i fixed the problem:
https://codesandbox.io/embed/xj36358myp