Cannot read property 'setRowData' of undefined

那年仲夏 提交于 2020-03-16 07:41:12

问题


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?


回答1:


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




回答2:


I faced this error when I did not add this line

modules = AllCommunityModules;

Hope this will help.



来源:https://stackoverflow.com/questions/44794635/cannot-read-property-setrowdata-of-undefined

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!