Completed
Last Updated: 17 Jun 2022 08:07 by ADMIN
Russell
Created on: 13 Nov 2019 15:16
Category: DataQuery
Type: Feature Request
0
Feature request: Expose a list of supported filter operators

Please export the operatorsMap from Data Query's filter-no-eval.js.

If exporting the operators map is not an option, consider introducing an enum which defines the operators as constants:

export enum Operators {
contains = 'contains',
doesnotcontain = 'doesnotcontain',
doesnotendwith = 'doesnotendwith',
doesnotstartwith = 'doesnotstartwith',
endswith = 'endswith',
eq = 'eq',
gt = 'gt',
gte = 'gte',
isempty = 'isempty',
isnotempty = 'isnotempty',
isnotnull = 'isnotnull',
isnull = 'isnull',
lt = 'lt',
lte = 'lte',
neq = 'neq',
startswith = 'startswith'
}

 

4 comments
ADMIN
Dimiter Topalov
Posted on: 17 Jun 2022 08:07

Hi,

The FilterOperator enum is available in v.1.6.0 of the @progress/kendo-data-query package.

Regards,
Dimiter Topalov
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/.

ADMIN
Dimiter Topalov
Posted on: 28 Nov 2019 09:17

Hi Russell,

Thank you for the provided details. I changed the type of this thread to a public feature request, visible on our Feedback portal so that other members of the community can support and comment it.

We will track the customer demand, and will consider exposing a type-checking mechanism for the FilterDescriptor operators.

Regards,
Dimiter Topalov
Progress Telerik

Get quickly onboarded and successful with your Telerik and Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Russell
Posted on: 25 Nov 2019 13:41

Dimiter,

Thanks for your reply. Here is an example code snippet which sets the default gridState on initial loading of a kendo grid.

 

Here, I am using an enum which duplicates the contents of the operatorsMap. I believe this should be built-in.

Having easy access to this info at compile time would also make it easier to make sure these operators are supported in server-side grid processing code.

 

export enum KendoOperators {
contains = 'contains',
doesnotcontain = 'doesnotcontain',
doesnotendwith = 'doesnotendwith',
doesnotstartwith = 'doesnotstartwith',
endswith = 'endswith',
eq = 'eq',
gt = 'gt',
gte = 'gte',
isempty = 'isempty',
isnotempty = 'isnotempty',
isnotnull = 'isnotnull',
isnull = 'isnull',
lt = 'lt',
lte = 'lte',
neq = 'neq',
startswith = 'startswith'
}

 

gridState: {
sort: [
{field: 'definition.shortName', dir: 'asc'}
],
filter: {
filters: [
{
operator: KendoOperators.eq,
field: 'includeOverrides',
value: true
},
{
operator: KendoOperators.eq,
field: 'includeDefaults',
value: false
}
],
logic: 'and'
}
}
ADMIN
Dimiter Topalov
Posted on: 18 Nov 2019 11:07

Hello Russell,

Could you please explain in further details what would you like to use the operatorsMap from the source code for, so we can consider exposing it or suggesting an alternative approach for achieving the desired result? Thank you in advance.

Regards,
Dimiter Topalov
Progress Telerik

Get quickly onboarded and successful with your Telerik and Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.