0
votes

How would I get a list of all the filters being used in a kendo angular grid? https://www.telerik.com/kendo-angular-ui/components/grid/api/GridComponent/

I have access to the grid in my angular component like so

@ViewChild(GridComponent) private grid;

I set the remote data

this.dataService.getItems().subscribe(
    data => {
      this.grid.data = data;
    }
)

I have to call an API similar to this. I tried using the filterChange event - it works fine until I clear a filter, the event fires but doesn't tell which event is fired.

.../api/items?filter1=value&filter2=value
1
The filterChange event will always return the currently active filter(s). If you clear a filter, it is removed. (the event may even be empty if that was the only active one)Philipp
@Philipp you're right, I missed a line and this was causing the unexpected behavior.pradhyo

1 Answers

0
votes

I missed the below line and this was causing unexpected behavior. Instead of containing information about all the filters it was only showing information about the filter that was changed.

<kendo-grid
        ....
        [filter]="filter"
        ....
>

Working demo - app.component.ts has the relevant code.
Changing the filters should log all the filters to the console. https://embed.plnkr.co/Ymz4CSFVmXirnxCFlAeE/