是否可以检测行数据何时折叠或展开

Is It possible to detect when row data is collapsed or expanded

我有一个要求,当行数据在 ag-grid 中折叠时我需要做一些事情。但是我找不到在 ag-grid

中折叠行数据时有帮助的特定函数

在 ag -grid 文档中 Docs 我发现网格事件 rowGroupOpened

以及文档中的事件截图Event

您可以绑定到此事件并使用您想要的功能;

<ag-grid (rowGroupOpened)='yourFunction($event)'></ag-grid>

在你的控制器中

yourFunction(event){
  console.log("Hello world");
  console.log(event); // to look all event prop
}

这对于 Angular 来说更复杂,但我会尽力为您提供想法。