Master detail row updates

时间:2019-02-18 00:40:03

标签: ag-grid ag-grid-react

I'm using AG grid react enterprise version and using master detail features to show details of a particular master row. I would like to add a feature to dynamically unselect all the detail rows previously selected by user. Is there any way we can do this? I'm programmatically not able to get reference to the detail row nodes.

1 个答案:

答案 0 :(得分:0)

您无需访问明细网格的rowNode即可清除选择。在细节网格api上具有句柄应该可以解决问题。

docs-

  

您可以通过主网格访问所有详细信息网格的API。的   每个详细信息网格的API存储在DetailGridInfo中

这是您可以做的-

// iterate over all DetailGridInfo's, and call clear seletion on each one
masterGridOptions.api.forEachDetailGridInfo(function(detailGridInfo) {
    detailGridInfo.api.deselectAll();
});

您应该能够根据自定义逻辑触发此操作,并取消选择详细信息行