无法读取未定义的属性“setRowData" [英] Cannot read property 'setRowData' of undefined

查看:31
本文介绍了无法读取未定义的属性“setRowData"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在我的 ag 网格上获取新数据.我尝试使用

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

this.gridOptions.api.setRowData(rowdata);

但它抛出这个错误

无法读取未定义的属性setRowData"

Cannot read property 'setRowData' of undefined

我在 onInit 方法的 onGridReady 方法中保留了这个方法.不确定这是否有帮助,但我也在使用 cellRenderer.

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?

推荐答案

gridReady 事件将 api 作为参数.尝试 event.api.setRowData(),或者使用 rowData 属性设置行数据.

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

这篇关于无法读取未定义的属性“setRowData"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆