0

Im filtering using remote mode in the Material-Table component, but after each filtered, and Material-Table rendered, it delete the text or selection from the filter section.

So I would like to understand if there is a way in the table to keep this values, because it is necessary that the user have reference of what he is seeing in the table.

Im using the last version, 1.32

This is the component https://github.com/mbrn/material-table

Best Regards and thanks in advance for your time in my case

Orestes
  • 637
  • 1
  • 4
  • 19

1 Answers1

-1

Move your columns object to a state.

Make a state var, const [materialColumn] = useState([{title: "Name",field: "name"}]); Then on your material table

<MaterialTable
     columns={materialColumnObj}
/>

This will solve the problem. The filter text will stay. Cheers!

Dan
  • 1
  • 1
  • Hi, First of all, This is an old question, from version 1.32. (actual version 1.69). This library isnot actively maintain anymore. Im not following anymore. I believe your solution is not complete. My advice for better answering is provide codesandbox example. Remember=> Your solutions must contain what they call the "remote mode" -> https://material-table.com/#/docs/features/remote-data Also, override filter component = >More information about how override a component material-table.com/#/docs/features/component-overriding Best Regards – Orestes Dec 19 '21 at 16:33