New grid filter operators not working correctly

5 posts, 0 answers
  1. Bryan
    Bryan avatar
    12 posts
    Member since:
    Jan 2015

    Posted 28 Mar 2016 Link to this post

    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.
  2. Rosen
    Admin
    Rosen avatar
    3253 posts

    Posted 31 Mar 2016 Link to this post

    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!
     
  3. Bryan
    Bryan avatar
    12 posts
    Member since:
    Jan 2015

    Posted 31 Mar 2016 in reply to Rosen Link to this post

    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.

  4. Rosen
    Admin
    Rosen avatar
    3253 posts

    Posted 01 Apr 2016 Link to this post

    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!
     
  5. Bryan
    Bryan avatar
    12 posts
    Member since:
    Jan 2015

    Posted 01 Apr 2016 in reply to Rosen Link to this post

    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.
Back to Top