Skip to content Skip to sidebar Skip to footer

Hide/unhide Actions Icons Based On State.vallue Value Reactjs

I want to hide the approved/disapproved button if the data.STATUS is equal to APPROVED in MaterialTable. const [data, setData] = useState([ {ID: 1, STATUS: 'APPROVED'}, {ID: 2, STA

Solution 1:

Add/Put the action icons/buttons in columns property.

{ title: 'Actions', sorting: false, render: rowData =><Linkto={`#`}
onClick={dosomething}style={{display:rowData.state==='approved' ? 'none' : 'block'}}
onClick={dosomething}
<Approveicon></Link> }

so the actions per column can be controlled

Post a Comment for "Hide/unhide Actions Icons Based On State.vallue Value Reactjs"