KranthiKiran V  Thrymr
KranthiKiran V Thrymr

Reputation: 11

how to get pinned row data in AG-grid angular

I am using ag-grid-angular in my angular application and pinned a row in the table. I want to get the values in the pinned row. How to do it?

Upvotes: 0

Views: 5721

Answers (1)

wentjun
wentjun

Reputation: 42526

As mentioned in the ag-grid documentation, we can pin rows either on the top, or the bottom of the grid.

Therefore, we can actually get the values of the pinned rows by using the in-built grid api by using gridApi.getPinnedTopRow(index) or gridApi.getPinnedBottomRow(index). Assuming you want to get the first top/bottom pinned row on the grid, you can do this:

console.log(this.gridApi.getPinnedTopRow(0).data);
console.log(this.gridApi.getPinnedBottomRow(0).data);

Upvotes: 3

Related Questions