如何在AG网格角度中获取固定的行数据

时间:2019-07-15 05:39:11

标签: angular ag-grid ag-grid-angular

我在我的角度应用程序中使用ag-grid-angular并将其固定在表中的一行。我想获取固定行中的值。怎么做?

1 个答案:

答案 0 :(得分:1)

如农业网格documentation中所述,我们可以将行固定在网格的顶部或底部。

因此,实际上,我们可以通过使用gridApi.getPinnedTopRow(index)gridApi.getPinnedBottomRow(index)使用内置的Grid API获取固定行的值。假设您要在网格上获得第一行顶部/底部固定行,可以执行以下操作:

console.log(this.gridApi.getPinnedTopRow(0).data);
console.log(this.gridApi.getPinnedBottomRow(0).data);
相关问题