【发布时间】:2020-03-29 02:03:25
【问题描述】:
我正在尝试通过以下方式更新 ag-Grid 行数据:
this.table.api.updateRowData({
update: [response.data]
})
更新工作正常,单元格获取更新后的值。但是,Ag Grid 不会重新评估该行的类别。此外,我收到一条错误消息:
ag-Grid:找不到数据项,因为找不到对象
这是我的 rowClassRule:
rowClassRules: {
"row-disabled": function(params) {
if (params.data.status != 1) {
return true
}
}
}
我在这里做错了什么,如何让 ag Grid 也更新课程?我试过使用:rowNode.setData(),它工作得很好(更新单元格值+类)-但我不能使用它,因为它没有刷新过滤器,很遗憾。
【问题讨论】:
-
您是否为您的网格实现了
getRowNodeId方法? -
你试过 api.refreshCells() 还是 api.redrawRows()。 “您的偏好应该是使用 refreshCells() 而不是 redrawRows()” - ag grid
标签: javascript ag-grid