Completed
Last Updated: 07 May 2021 11:26 by Anthony
Anthony
Created on: 03 May 2021 07:25
Category: DataQuery
Type: Feature Request
0
Expose operatorsMap, to add custom filtering

Hi,

I've just started to use the process method of the Data query library and there is no way of filtering a property that is an array, even as simple array such as Array<string>.

ie:

interface Person {

  id: string;

  name: string;

  categoryIds: Array<string>

}

I have many instances where I have properties that are arrays of string ids, so was hoping to use this utility to help filter the data.

Whilst adding an additional operator such as includes would help, how about adding the ability to register a custom operators?

Thanks,
Anthony.

 

2 comments
Anthony
Posted on: 07 May 2021 11:26
Thanks so much for showing me how.
ADMIN
Dimiter Madjarov
Posted on: 07 May 2021 11:14

Hello Anthony,

Custom operators can be registered by providing a callback function as a value for the operator field:

https://www.telerik.com/kendo-angular-ui/components/data-query/api/FilterDescriptor/#toc-operator

Here is an example demonstrating how to achieve the same

https://stackblitz.com/edit/dq-filter-function?file=index.ts

We have noticed that our documentation is very sparse in that matter, so we have logged an internal item to update it accordingly. Thank you for bringing our attention to this.

Regards,
Dimiter Madjarov
Progress Telerik

Тhe web is about to get a bit better! 

The Progress Hack-For-Good Challenge has started. Learn how to enter and make the web a worthier place: https://progress-worthyweb.devpost.com.