I am using a AgGrid and want to have a cell with link and I want to navigate to some React route on click of the link.
cellRenderer: 'linkColRenderer'
For some reason, the below code for linkColRenderer does not work
import React from 'react';
export default (props) => {
var link = document.createElement('a');
link.href = '#';
link.innerText = props.value;
link.addEventListener('click', (e) => {
e.preventDefault();
console.log(props.data.id);
});
return (
<>
<span>{link}</span>
</>
);
const goToDetails = (params) => {
//Go to some route...via props.history.push
}
//return <a href="javascript:;" style={{color: '#000000'}}>{props.value}</a>
};