2
votes

I am trying to get new data on my ag grid. I tried using

this.gridOptions.api.setRowData(rowdata);

but it throws this error

Cannot read property 'setRowData' of undefined

I have kept this method in the onGridReady method at the onInit method. Not sure if that helps, but I am using cellRenderer also.

Does this method work for anyone else?

Is there anything specific to call this method?

2
Can you post your code here? - S. Baggy

2 Answers

5
votes

The gridReady event has the api as a parameter. Try event.api.setRowData(), or set the row data using the rowData property instead.

0
votes

I faced this error when I did not add this line

modules = AllCommunityModules;

Hope this will help.