Custom Filter Operators

1 Answer 424 Views
Filter
Phil
Top achievements
Rank 1
Phil asked on 16 May 2022, 12:38 PM
It would be greatly beneficial to our projects if there were enhancements to the Filter component to allow for supplying custom Filter Operators. For example, our legacy software provided native "Between" operator support along with custom "Date Range" operators, such as "today", "Yesterday", "This Week", etc. While I wouldn't expect Telerik to support these out of the box, it would be great to be able to add our own operators/Filter types.

1 Answer, 1 is accepted

Sort by
0
Tsvetomir
Telerik team
answered on 18 May 2022, 01:21 PM

Hi, Phil,

Thank you for taking the time to share your feedback. Currently, the Filter component is intended to have only strongly-typed filter operator values, more specifically, the operator should be of type FilterOperator Enum. It comes with a set of predefined values for all built-in operators. If we were to expose an option to add a custom operator, it would break the strongly-typed orientation of the component.

Currently, we have a pending Feature Request in our feedback portal regarding the field template option of the Filter:

https://feedback.telerik.com/blazor/1561874-filter-field-template

Whenever it gets implemented, you will be able to declare two date pickers and built custom filter descriptors that will play the role of the "Between" operator. We have a similar example for the grid that filters a numeric field by a range between two numeric values (the Price column in the demo below):

https://demos.telerik.com/blazor-ui/grid/custom-filter-row

As an alternative, you can override one (or many) of the predefined operators and execute custom logic for the filtering. Check the following POC example:

https://blazorrepl.telerik.com/wGkzlilm34568tY852

I hope you find the information above helpful.

Kind regards,
Tsvetomir
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/.

Víctor
Top achievements
Rank 1
Iron
Iron
Iron
commented on 09 Mar 2023, 05:08 PM

I would also like to extend the default filters.

Why not using a class hierarchy instead of an enum? This way we could add out own subclases.

I need my users to be able to have dropdowns for related entities.

Tsvetomir
Telerik team
commented on 13 Mar 2023, 07:27 AM

I recommend sharing your opinion and feedback directly in the feature request's item so that whenever a developer starts working and researching, they'll implement it in such a way that is helpful for all:

https://feedback.telerik.com/blazor/1561874-filter-field-template

 
Tags
Filter
Asked by
Phil
Top achievements
Rank 1
Answers by
Tsvetomir
Telerik team
Share this question
or