Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get the number of filtered rows in ag-Grid?

I have an ag-Grid with filtering option.

How to get the number of filtered rows without using forEachNodeAfterFilter callback?

I want to enable a button only if there is a filtered row, and i don't want to perform a foreach loop in the background every time.

like image 663
Gábor Csikós Avatar asked Apr 21 '17 12:04

Gábor Csikós


People also ask

How do you get the number of rows in Ag grid?

Api the AgGrid: getDisplayedRowCount() Returns the total number of displayed rows.

How do you get Rowdata on Ag grid?

The easiest way to get a Row Node is by its Row ID. The ID is either provided by you using the grid callback getRowId() , or generated by the grid using an internal sequence.

What is gridOptions in Ag grid?

The gridOptions object is a 'one stop shop' for the entire interface into the grid, commonly used if using plain JavaScript. Grid options can however be used instead of, or in addition to, normal framework binding. The example below shows the different types of items available on gridOptions .

How do you put a progress bar on Ag grid?

Grid Cells with Progress Bar To show a progress bar in cells of specific column, you need to set the editorType field of column object to Progress. After that, you can set the cell value field with a number from 0 to 100. This will update the progress bar in each cell separately based on the cell value.


1 Answers

What you are probably looking for is:

gridOptions.api.getDisplayedRowCount()

The actual number of rows after the filtering event is trivially the number of displayed rows.

like image 124
LittleXenomorph Avatar answered Sep 24 '22 06:09

LittleXenomorph