I have encountered an error while using filtering with DropDownTree. I am currently using kendo-angular-dropdowns 5.5.1 in my project, but I have reproduced this error with 6.0.2. Here are the conditions:
- Use kendoDropDownTreeFlatBinding with kendoDropDownTreeExpandable directive.
- Setup value binding and initialize the value to a child entry in the list.
- Run and attempt to filter the dropdown. Some searches will produce the error:
https://angular-e7ahkr.stackblitz.io:
import { Component } from '@angular/core';
@Component({
selector: 'my-app',
styles: ['.furniture { width: 250px; }'],
template: `
<kendo-dropdowntree
kendoDropDownTreeExpandable
[kendoDropDownTreeFlatBinding]="data"
parentIdField="reportsTo"
valueField="id"
textField="name"
[(ngModel)]="person"
class="furniture"
[filterable]="true"
[expandOnFilter]="{ expandMatches: true}"
>
</kendo-dropdowntree>
`,
})
export class AppComponent {
public data: any[] = [
{ id: 2, name: 'Andrew Fuller', reportsTo: null },
{ id: 1, name: 'Nancy Davolio', reportsTo: 2 },
{ id: 3, name: 'Janet Leverling', reportsTo: 2 },
{ id: 4, name: 'Margaret Peacock', reportsTo: 2 },
{ id: 5, name: 'Steven Buchanan', reportsTo: 2 },
{ id: 8, name: 'Laura Callahan', reportsTo: 2 },
{ id: 6, name: 'Michael Suyama', reportsTo: 5 },
{ id: 7, name: 'Robert King', reportsTo: 5 },
{ id: 9, name: 'Anne Dodsworth', reportsTo: 5 },
];
public person = this.data[6];
}