0
votes

I'm using Ag Grid for Angular 2.

Upon trying to the filter, the filter icon is not getting displayed in the grid header of the column after fetching the data.

Refer this Image

Icon was displaying until this line executes:

self.gridOptions.api.setRowData(self.rowData);

If I Remove ad-hidden from html then the Icon is getting displayed. Not sure what is happening in the background.

If needed i can post my code.

Icon HTML:

<span ref="eFilter" class="ag-header-icon ag-filter-icon ag-hidden" aria-hidden="true"><span class="ag-icon ag-icon-filter"></span></span>
1
when you hover the header of the column, does the hamburger icon appear?Angela P
Yes. Hamburger icon is appearingarunkumar
if you want to have a input field + filter icon under the column header, gridOptions = {floatingFilter: true} more examples here: ag-grid.com/javascript-grid-filteringAngela P
Filter is working fine, problem is once the data is loaded filter icon near the header text gets hiddenarunkumar

1 Answers

0
votes

The issue here, according to this line:

self.gridOptions.api.setRowData(self.rowData);

is that you are setting data in the grid again...

If you set data into the grid, you are resetting the whole state of the grid back to 0.

You could then listen to this event, and restore any previous filter.