Checkbox Filter Not Working As Expected on Programmatic Filter

1 Answer 61 Views
Filter  Grid
Janki
Top achievements
Rank 4
Bronze
Iron
Iron
Janki asked on 25 Feb 2022, 09:18 PM | edited on 25 Feb 2022, 09:36 PM

I'm setting the filter of a col with blank (""), null, and real values programmatically. I also want to use the checkbox filter so that when the user filters out the nulls and "", they can further filter down the real values. But when you set the filter programmatically, the null and "" values are selected in the checkbox filter (incorrect) while the grid itself filtered them out (correct).

If I change the checkbox filter to take in the new filtered data, it still shows "2 values selected" even though we're not technically selecting null and "" (I understand they're still being used as "values" in the filter object itself).

My problem lies with the fact that the values are "selected", which requires the user to need to manually de-select these two options to further filter down the filtered data.

Any ideas/workarounds for this edge-case/niche situation?

https://stackblitz.com/edit/react-x2xqag?file=app/main.jsx

1 Answer, 1 is accepted

Sort by
0
Konstantin Dikov
Telerik team
answered on 27 Feb 2022, 11:25 AM

Hi Janki,

Thank you for providing an example demonstrating the issue.

The issue that you are facing is due to the fact that the column menu checkbox filter searches internally for filter expressions for the specific field and does not take into account what is the actual operator, because it expects it to be "eq" (which is the only operator that comes from the checkbox filtering). In my opinion, this should be considered a bug in the checkbox filtering logic and only the "eq" expressions should be checked. 

Nevertheless, what I could suggest for resolving the issue with the current state of the Grid is to filter the data from the external filters separately from the internal Grid filters. This will allow you to have two levels of filtering - one external and one internal. I was testing some things over your example and I came up with the following solution (which I am sure can be optimized):

As for the actual checkbox filtering problem, I will have to consult with the developers team to see if we should log this as a bug or mark it as limitation. 

 

Regards,
Konstantin Dikov
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
Filter  Grid
Asked by
Janki
Top achievements
Rank 4
Bronze
Iron
Iron
Answers by
Konstantin Dikov
Telerik team
Share this question
or