Page 1 of 2

[ANGULAR] How to enable FilterBarFeature for specific columns

Posted: Tue Jan 18, 2022 8:51 am
by abisht

Angular version - 8.12.14
Bryntum version - 3.0.3

Below code i added in the html and it is enabling the all the columns. Is there any config change required to enable for specific column?

<bry-scheduler
[filterBarFeature]="'true'" >
</bry-scheduler>


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

Posted: Tue Jan 18, 2022 9:15 am
by alex.l

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

Posted: Wed Jan 19, 2022 9:20 am
by abisht

Is there any event which will trigger only on filter change?


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

Posted: Wed Jan 19, 2022 9:30 am
by alex.l

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

Posted: Wed Jan 19, 2022 12:08 pm
by abisht

On change of filter value i need to call the backed API and get new set of filter data. I was doing on onSchedulerEvents(event),checking for the event.type = 'resourceschange' then calling API. But this is going in loop because resourceschange type is calling when action is filter and dataset. dataset is again calling filter action.

is there any way to handle the Filterchanges to call backend api ?


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

Posted: Wed Jan 19, 2022 1:19 pm
by abisht

How to handle the server side filtering?


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

Posted: Wed Jan 19, 2022 7:53 pm
by abisht

Hi Alex,

Below is my config file. I want to filter on driver Name. On each keypress i need to call the API and show the result on UI.
Is this possible.?

columns: [{
      text: 'Driver',
      field: 'name',
filterable: ({ record ,value}) =>  {
        this.FiltersChanged(value);
        return record;
      }
}
]
public FiltersChanged(event: any) { 
	http call 
}

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

Posted: Thu Jan 20, 2022 8:46 am
by alex.l

Better to enable remote filtering and just send your filter params with store reload, handle it on the server side and return filtered data.
All you need to enable remote filtering is define https://bryntum.com/docs/grid/api/Core/data/AjaxStore#config-filterParamName for your store.
Docs here: https://bryntum.com/docs/grid/api/Core/data/AjaxStore#remote-filtering


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

Posted: Thu Jan 20, 2022 2:27 pm
by abisht

Hi alex,

Thanks for support. one more issue i am facing.

{
      text: 'Driver',
      field: 'name',
      htmlEncode: false,
      filterable: {
        filterFn: ({ record, value }) => value,
        keyStrokeFilterDelay: 600,
        filterField: {
          emptyText: 'Filter name',
          listeners: {
            input: (event: any) => {
              this.onFiltersChanged(event.value);
            }
          }
        }
      },
      resizable: false,
      editor: false,
      width: 100,
      draggable: false,

i am using listeners on input. i am able to filter the from api able to bind the data to UI. after the bind it is clearing the filter text.
Is there any way to not to clear the filter text?


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

Posted: Thu Jan 20, 2022 2:55 pm
by alex.l

Did you return your filters data back in your response? It should be re-applied from the data.