class abc extends React.Component{
_handleClick(){
console.log("some API call and state change");
}
}
columndefs: [
{headerName:'Label', field: 'label', width:130, pinned:'left', cellClass:'ag-cell-text-align-center', cellRenderer:linkRenderer},
{headerName:'Received', field: 'receivedDate', width:130, cellClass:'ag-cell-text-align-center'},
]
function linkRenderer(){
return params.data.link ? `<span style=text-decoration:underline;color:blue;cursor:pointer onClick="this._handleClick()">${params.value}</span>`: params.value;
}
这说明“this._handleClick 不是函数”所以,如何在 linkRenederer 中调用 this._handleClick