`const EditableCellRenderer: React.FC<any> = (props) => {
console.log("EditableCellRenderer working")
const { value } = props;
const [cellValue, setCellValue] = useState(value);
const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {
setCellValue(e.target.value);
};
return (
<input
type="text"
value={cellValue}
onChange={handleChange}
style={{ width: '100%', height: '70%', borderRadius: '0px', border: '1px solid #D1D1D1', padding: '3px' }}
/>
);
};
const colDef: ColDef<RowData>[] = useMemo(() => [
{ headerName: 'Parameter', field: 'parameter',cellRenderer: CustomCellRenderer },
{
headerName: 'Value', field: 'value',
cellRenderer: isEditMode ? EditableCellRenderer :undefined,
},
{
headerName: '',
field: 'auditlink',
maxWidth: 130,cellRenderer: (props: any) => <Link to='' className='styled-link' onClick={() =>handleAuditLog(props)}>Audit</Link>,
},
], []);`
This is my code.
EditableCellRenderer is not invoking since it’s in the ternary operataor.
It is working in javascript.
Please help me to resolve it
New contributor
Meruthiga Ravichandran is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.