I'm trying to setup some custom filter types on my grid (using server filtering) to show only Blank or Non-blank rows. Add add the custom filters to the columns and see my new items in the dropdown. So far so good. However, when I select either of those and then don't type anything in the text boxes the FilterMenu's _merge() function removes them from the filter as there is no value in the text box. Is there any way I can currently get around this without modifying the _merge() to not remove filters with my new types if the filter text is empty? Or is there any other way to accomplish this type of filter?
Thanks,
Matt
Here's my current column filterable setup in case it helps:
{
extra:
true
,
operators: {
string: {
eq:
"Is equal to"
,
neq:
"Is not equal to"
,
startswith:
"Starts with"
,
contains:
"Contains"
,
endswith:
"Ends with"
,
blank:
"Is blank"
,
notblank:
"Is not blank"
},
number: {
eq:
"Is equal to"
,
neq:
"Is not equal to"
,
gte:
"Is greater than or equal to"
,
gt:
"Is greater than"
,
lte:
"Is less than or equal to"
,
lt:
"Is less than"
,
blank:
"Is blank"
,
notblank:
"Is not blank"
},
date: {
eq:
"Is equal to"
,
neq:
"Is not equal to"
,
gte:
"Is after or equal to"
,
gt:
"Is after"
,
lte:
"Is before or equal to"
,
lt:
"Is before"
,
blank:
"Is blank"
,
notblank:
"Is not blank"
}
}
}
7 Answers, 1 is accepted
I am afraid there is not another way to enable this behavior in the filter menu besides modifying the method. You should override the function in the grep method so that it returns true when the blank/notblank operator is used e.g.
filters = $.grep(filters,
function
(filter) {
return
filter.operator.indexOf(
"blank"
) >= 0 || filter.value !==
""
;
});
Daniel
the Telerik team

I am also looking for this feature, but I am not sure how & where to use your code, can you point out to some sample to implement this functionality.
There is not a sample because as I mentioned in my previous reply, this feature is not supported. You may consider opening a feature request in our user voice forum.
The approach that I suggested in my previous reply was to modify the code for the FilterMenu. Specifically the _merge function so that an empty string is considered as valid value. If client filtering is used, then the operators should also be added in the kendo.data file. Besides modifying the code, you could also use an external filter or add some custom buttons to the filter menu in the fitlerMenuInit event and use the filter method with the "eq", "neq" operators to filter the data.
Daniel
the Telerik team

Can you please advise if you have such a feature on the roadmap or I need to request it?
Also, if you have an example (and can share it :-)) on how I can implement it using external filter approach (if it is still suggested) - that will be terrific!
Thank you,
Andrei
This feature is still not available, but is already submitted at Kendo UI Feedback portal. You can cast a vote for it and track its status here.
Regards,
Alexander Valchev
Telerik

This functionality is still not available. Please cast a vote for it at the link from my previous reply.
Regards,
Alexander Valchev
Telerik