Alex Wachira
Alex Wachira

Reputation: 1335

How can I filter a table by the selected rows in ag-Grid?

Since select is an attribute of the RowNode and not part of the data, how can I filter a table by those rows which have select: true?

I'm aware of the gridApi.getSelectedNodes() I've also tried text and number filter.

In a table of 10,000 items. The user needs the ability to only see the rows they've selected after scrolling and checking several rows.

Upvotes: 2

Views: 1141

Answers (2)

Nishmitha S
Nishmitha S

Reputation: 1

Try this:

let selectedNodes = this.gridApi.getSelectedNodes();

let selectedData = selectedNodes.map(node => node.data);

Upvotes: 0

Ostoja
Ostoja

Reputation: 119

you could do gridOptions.api.setRowData(gridOptions.api.getSelectedRows()) getSelectedRows returns data of selected rows

Upvotes: 1

Related Questions