简体   繁体   English

ag-grid angular - 选择更改时刷新组行

[英]ag-grid angular - refresh group row on selection change

I've combed the docs and API references, but I'm not seeing a way to trigger a refresh to a group row when a selection changes has been made to it's children. 我已经梳理了文档和API引用,但是当我对其子项进行选择更改时,我没有看到触发刷新组行的方法。

Working ag-grid in angular 7, I'm using a custom renderer for the group inner and would like to be able to change the styling of the group based on the selection being made. 在角度7中使用ag-grid,我正在为组内部使用自定义渲染器,并希望能够根据所做的选择更改组的样式。 I would prefer to not rerender the grid, but only refresh the group row if possible. 我宁愿不重新渲染网格,但只在可能的情况下刷新组行。

Aside from storing the selection in a store, is there any way to trigger such a refresh on a group row? 除了将选择存储在商店中之外,有没有办法在组行上触发这样的刷新?

My suggestion for doing this 我建议这样做

onCellChanged() {

  Data = this.gridApi.getSelectedRows();

make key-value pair by passing some sort of id 通过传递某种id来创建键值对

After using this 使用完之后

    this.gridApi.forEachNode(function(rowNode) {}

compare id in both and 比较两者中的id

Pass this into ag-grid function in which you are setting your grid data 将其传递到ag-grid功能,您可以在其中设置网格数据

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM