First time writing here so apologies if I'm not doing it correctly. I am trying change the value type of a string into an integer when importing values into my AG Grid in React. In order to do this, I created this column header :
{
headerName: "calc inline clicks",
field: "adsetstats_inline_link_clicks",
aggFunc: "sum",
valueGetter: params => {
return parseInt(params.data.adsetstats_inline_link_clicks_0days_ago);
}
}
I then run:
this.setState({ rowData })
However, when I run this, React gives me the following error:
Error: ag-Grid: cannot get grid to draw rows when it is in the middle of drawing rows. Your code probably called a grid API method while the grid was in the render stage. To overcome this, put the API call into a timeout, eg instead of api.refreshView(), call setTimeout(function(){api.refreshView(),0}). To see what part of your code that caused the refresh check this stacktrace.
Any idea how to fix this? Nothing I have done seems to work.
Thanks, Gabriel