I am using react material-table. I am in need of a feature like this: I use remote data mode to get a list of records, then I use the custom column rendering function to add a Material Button at the end of each row in the table, When the user presses this button I want it to be hidden. How can I do that. I look forward to receiving your help.
How to hide button after pressing in material-table
730 views Asked by Things I like At
1
I made this example, on button click it gets disabled and a variable is set to to a loading state:
The key aspect here is to define something that identifies the row that is being updated. I use an extra
column
on which you could also display a spinner component:Since you want to render the button as a custom column (other way could be using actions), on the render attribute of that column, you can use
rowdata
parameter to access what you are looking for:Here is the link to the sandbox and the complete code, I hope this works for you!