Page 2 of 2

Re: [ANGULAR] How to enable FilterBarFeature for specific columns

Posted: Thu Jan 20, 2022 3:21 pm
by abisht

Any example how i need to reapply ?


Re: [ANGULAR] How to enable FilterBarFeature for specific columns

Posted: Fri Jan 21, 2022 9:18 am
by abisht

Any way to retain the filter value and show it on the UI


Re: [ANGULAR] How to enable FilterBarFeature for specific columns

Posted: Fri Jan 21, 2022 9:59 am
by alex.l

I think I misunderstood your question. I don't see that filterBar state is cleared after data reload.
Could you please make a small test case that we can run and debug?


Re: [ANGULAR] How to enable FilterBarFeature for specific columns

Posted: Fri Jan 21, 2022 10:21 am
by abisht

Hi Alex,

'resourcesrefresh' event is getting triggered and setting filter value to empty.

i have add the below add in angular ts file

this.schedulerConfig.columns.filter(column  => {
      let changesValue ;
      if (column.field === 'name') {
        column.filterable['filterField']['listeners'] = {
          input: (event: any) => {
            if(event){
              this.onFiltersChanged(event.value);
            } 
          }
        }
      }
      return column;
    });
    onFiltersChanged(filterInput){
    i have http call and getting filtered data from backend and binding to ui
    } 
    
after this resourcesrefresh is calling and filterbar state is getting cleared

Thanks


Re: [ANGULAR] How to enable FilterBarFeature for specific columns

Posted: Fri Jan 21, 2022 11:13 am
by alex.l

What is resourcesrefresh event?
It looks like you re-apply configs for columns. In that case if it's recreated, you have to take care by your own about data in filterBar.
I cannot say a lot by this code fragment. Just try to save and re-apply data after your refresh using? To get the field, use https://bryntum.com/docs/grid/api/Grid/feature/FilterBar#function-getColumnFilterField