Ag Grid filtering

Hi All,
I’m havin two problems with Ag Grid filter.

  • if Grid refreshes during filtering (rowTransactions) filter erases my choice and I have to begin filtering from the beginning.

is there any solution for holding filter data even when grid row data changes? please check my code.

  • second issue is that when using comparator infilterparams , string type column “po_line” is not sorting as number .
columndefs = [
        {'field':'site_code', "headerName":"SITE CODE",'hide':False,'filter':'agSetColumnFilter','filterParams': {'excelMode':'Mac'}},
![Bez tytułu|362x220](upload://zZveMFwlkqEkSMciO3qJiUGozBP.jpeg)

{"field":"po_line","headerName":"LINE","editable":False,"hide":False,'filter': 'agSetColumnFilter','filterParams':{"comparator": {"function": "sortFilterList"}}}
![Bez tytułu|249x205](upload://3a1SRJNcKdru3GyOl0iY5xDOe4F.jpeg)

thanks in advance

Hello @acidkans,

Could you create an example app to demonstrate the issues that you are encountering?

This is fairly abstract right now.

As far as sorting, you need to make sure you pass the same sort of comparator as the filter. :slight_smile:

  • first problem is shown below, serach field keeps refreshing, so no chose can be done in reasonable time…between refreshes

  • comparator topic
    my line of code is:

{“field”:“po_line”,“headerName”:“LINE”,“editable”:False,“hide”:False,‘filter’: ‘agSetColumnFilter’,‘filterParams’:{“comparator”: {“function”: “sortFilterList”}}}

I have string column

Without seeing your code, its really hard to understand what exactly you are doing.

As far as the rowTransactions, what are you passing? Are you using getRowId?

For the comparator for the sort, you need to actually pass it, you are only passing it to the filter. :slight_smile: