Shubham Joshi
Shubham Joshi

Reputation: 42

How to apply filter on remote data

I am stuck on an issue on kendo-treeview angular. In static data filter is working but on remote data filter is not working.

https://www.telerik.com/kendo-angular-ui/components/treeview/data-binding/#toc-remote-heterogeneous-data

Upvotes: 0

Views: 194

Answers (1)

alexdefender93
alexdefender93

Reputation: 176

The remote data filter is not going to work out of the box. You have to implement it manually. See https://www.telerik.com/kendo-angular-ui/components/treeview/filtering/#toc-manual-filtering for details. To do that:

  1. Add [filterable]="true"
  2. Listen for (filterChange) event
  3. Filter categories

See my proof of concept based on kendo example: https://stackblitz.com/edit/angular-moowpy?file=src%2Fapp%2Fapp.component.ts

Filtering children or filtering categories based on children's data is possible but more complicated because it requires changing the API. I can imagine some additional request that would return categories based on filter query. But that depends on your application logic and architectural decisions.

Upvotes: 0

Related Questions