material-table
material-table copied to clipboard
How to get actual row index adding/editing?
Hello!
I want to know how to get the actual row index when i am adding/editing a line, is it possible?
I am overriding the EditField component like this, because i want to display a context menu per cell and do other things...
`
components={{
EditField: (props) => {
return (
<TextField
type={props?.columnDef?.type}
onChange={(e) => props.onChange(e.target.value)}
onContextMenu={(e) => {
e.preventDefault();
//TODO: display menu options
}}
onFocus={(e) => {
console.log("Focused column field", props?.columnDef?.field);
//TODO: use this field id to do something in menu options
}}
value={props.value || ""}
/>
);
},
}}/>
`

I would greatly appreciate the help.
Federico.
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.