ag-Grid行未删除 [英] ag-Grid row not deleting

查看:353
本文介绍了ag-Grid行未删除的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从ag-Grid删除行,如下所示:

I am trying to delete a row from my ag-Grid like so:

let alertRow : RowNode = this.gridApi.getRowNode(rowIndex);
console.log(alertRow);
this.gridApi.updateRowData({remove: [alertRow]});

它给了我这个错误:


ag-Grid:找不到数据项,因为找不到对象

ag-Grid: could not find data item as object was not found

我可以在控制台中看到 RowNode 是正确的节点并存在。我还可以使用 updateRowData()很好地添加新行,但是尝试删除会出现此错误。

I can see in console the RowNode is the correct node and exists. I am also able to use updateRowData() to add new rows in fine but trying to remove gives this error.

我正在Angular 6组件中使用ag-Grid。

I am using ag-Grid in Angular 6 component.

为什么删除不起作用?

推荐答案

updateRowData({remove:[alertRow.data]}))


已更新文档

...如果不使用ID,则网格将根据对象引用匹配行。

... If you are not using ID's, then the grid will match the rows based on object reference.

这篇关于ag-Grid行未删除的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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