Angular Custom DropdownList for Grid Filters throwing me errors

1 Answer 102 Views
DropDownList Grid
Andrei
Top achievements
Rank 1
Andrei asked on 27 Jun 2022, 11:38 AM
Hello, I'm having trouble managing to create a custom component for a filter inside a grid. I've started based on the documentation with the DropdownList custom component (here) and I provided the correct data to it (filters and options) and every time I select an option it throws me an error (attached image). I replicated the exact example from the documentation and I'm encountering the same issue. Can anyone tell me what I'm doing wrong? I also provided the data I'm passing from the parent component (the first is the filter object, the second is data with the available options). Thanks in advance.

1 Answer, 1 is accepted

Sort by
0
Martin Bechev
Telerik team
answered on 30 Jun 2022, 07:38 AM

Hi Andrei,

Thank you for the provided screenshots.

I tested the demo from our site in an isolated Angular 13 project, but it works as expected. Having said that I will need to check the code and how the DropDownList is defined on your side.

Based on the information so far I can suggest to double-check how the FilterDescriptor is generated more specifically this part of the code:

 public onChange(value: unknown): void {
    this.applyFilter(
      value === null // value of the default item
        ? this.removeFilter(this.valueField) // remove the filter
        : this.updateFilter({
            // add a filter for the field with the value
            field: this.valueField,
            operator: "eq",
            value: value,
          })
    ); // update the root filter
  }

In case the issue persists, please could I ask you for a runnable project which reproduces the issue. Thus we can debug the code and be able to provide further assistance on the case. Thank you in advance.

Regards,
Martin
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
DropDownList Grid
Asked by
Andrei
Top achievements
Rank 1
Answers by
Martin Bechev
Telerik team
Share this question
or