Change value of row with action without losing filter states
Hello,
I want to change the value of a row with a table action. If I choose not to update the table, it won't reflect the change I've made to the table data, because it has not re-rendered. If I render again to update the data viewed by the user, then I lose the current filtering state. I know there is a defaultFilter value, so in theory I could capture the current filter values as state, and set them again with the next update. However, I don't know how I could retrieve the current filter states.
Is there a way to do this?
Second this. I too am trying to find out where/how the current filter state is stored so that I can reference it for another purpose. Can anyone please advise? I haven't found any documentation on this here, in stackoverflow, or elsewhere - there's got to be a way right?
#491 as patricekaufmann said https://github.com/mbrn/material-table/issues/491#issuecomment-541011677
let [columnObject] = useState({title: "col",field: "col"});
=>
<MaterialTable columns={ [ columnObject ] }/>
I use columns
const [ columns ] = useState([
{
title: "",
field: "",
lookup: {},
defaultFilter: [""],
},
]);
<MaterialTable
columns={columns}
/>
is also ok, the filter states will not lose.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. You can reopen it if it required.
I haven't tested the proposed solution but guessing it probably works. Thanks @jiangtaozy