there's a way to get rowData props passed to the property icon on actions?
In example, I have a button action in the action as a column, but I want this button rendered by the icon that it could receives state, that button has css properties that change due the state receiving in parameter. Or even disabled getting row props too, it would help so much
How could I access rowData inside the component I'm rendering in the icon property of actions?
actions={[
{
disabled: (rowData) => {rowData.isDisabled}
icon: (iWannaThisPropRowData)=> { return ( <NewUserButton onClick={null} prop = iWannaThisPropRowData.isActive/> )},
onClick: (e, rowData) => handleSetAddUser(rowData, setAddUserGroupRowIndex, setOffAddUserGroup)
},
]
}
You can pass a function as the action and access the rowdata like this:
rowData => ({
icon: 'delete',
tooltip: 'Delete User',
onClick: (event, rowData) => confirm("You want to delete " + rowData.name),
disabled: rowData.birthYear < 2000
})
I didn't see the interface index, its able to receive a function that return Action
I suggest admin to put a props on the function of property icon of interface Action
