This is a migrated thread and some comments may be shown as answers.

New grid filter operators not working correctly

4 Answers 146 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Bryan
Top achievements
Rank 1
Bryan asked on 28 Mar 2016, 06:40 PM
I recently created a new project with the latest Kendo code. The project has numerous grids and most of them use filter rows. I do all my grid filtering, sorting, paging, and grouping on the server side using the DataSourceRequest object that the grid passes through the grid's data source read action. I noticed that in the latest version of Kendo, there are four new filter operations: Is Null, Is Not Null, Is Empty, and Is Not Empty. Those seem like good options to have for filtering. The problem is that, in their current form, they're unusable for server side filtering. The filters in the DataSourceRequest object are not providing the critical Member property when using any of the new operations so I have no way of knowing which columns in my database the new filters should be applied to. Can you tell me if you are aware of this issue and, if so, when you will fix it? Also, is there a way to keep those operations (or any of the others for that matter) from showing up in the list of filter operators? Thanks.

4 Answers, 1 is accepted

Sort by
0
Rosen
Telerik team
answered on 31 Mar 2016, 06:11 AM

Hello Bryan,

I'm afraid I'm not able to observe such behavior locally using the provided information. Please take a look at this short video which captures the DataSourceRequest state during filtering. Maybe I'm missing something obvious. Also it will be appreciated if you could provide a small runnable sample which demonstrate the issue you are experiencing.

Regards,
Rosen
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Bryan
Top achievements
Rank 1
answered on 31 Mar 2016, 10:18 PM

Apparently, I didn't have the latest Kendo version. There was a bug in 2016.1.112 that caused this. It appears to be fixed in 2016.1.226.

My other question remains unanswered however. How can I selectively "turn off" specific filter operators so that they don't show up in the UI? I have two reasons for wanting to do this. The first is that I don't have the time to write the code to implement the new operators in my server code at the moment. The second is that the "Is null" and "Is not null" operators are too geeky for the average end user. I could prefer to combine their functionality into the "Is empty" and "Is not empty" options when I do implement them.

One suggestion for you guys would be to interpret a null value setting for the operator text to mean that the operator should be removed. It doesn't do that currently, but it would be a straightforward way to give developers the option to selectively remove operators.

0
Rosen
Telerik team
answered on 01 Apr 2016, 01:36 PM

Hello Bryan,

You could modify the filter operators shown in the filter menu for given column using the BoundColumn's Filterable setting, similar to the following:

 

columns.Bound(c => c.Field)
      .Filterable(filterable => filterable
          .Operators(ops => ops
              .ForString(str =>
                  str.Clear() // remove all of the operators and add only those which are necessary
                      .Contains("Contains")
                      .DoesNotContain("DoesNotContain")
                      //...etc...
                  )));

 

Regards,
Rosen
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Bryan
Top achievements
Rank 1
answered on 01 Apr 2016, 04:58 PM
Thank you. This was what I was looking for. I also found the I could use the grid's .Filterable() method instead of the one for individual columns to do the same thing.
Tags
Grid
Asked by
Bryan
Top achievements
Rank 1
Answers by
Rosen
Telerik team
Bryan
Top achievements
Rank 1
Share this question
or