filtering a field for nulls

4 posts, 0 answers
  1. Cecil
    Cecil avatar
    15 posts
    Member since:
    Dec 2011

    Posted 02 Apr Link to this post

    How would I set up a filter that looked for null values in a numberic field?

    filter currently looks like this:

    '$and': [
                    { 'CompanyId': null },
                    { 'IsActive': true }
                ]

     

    If I look for a value in CompanyId it works, but trying find items with null values (or "Not set") finds nothing.

  2. Rosen
    Admin
    Rosen avatar
    3234 posts

    Posted 05 Apr Link to this post

    Hello Cecil,

    We current version of Kendo UI we have added isnull and isnotnull filter operators. You should use them in order to filter only values which are null.

    Regards,
    Rosen
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  3. Kendo UI is VS 2017 Ready
  4. Cecil
    Cecil avatar
    15 posts
    Member since:
    Dec 2011

    Posted 05 Apr Link to this post

    Is there a value such as {field: 'CompanyId', operator: 'isnull', value true}?

    Because I know it's got to be looking for something.

  5. Rosen
    Admin
    Rosen avatar
    3234 posts

    Posted 06 Apr Link to this post

    Hello Cecil,

    You can omit the value as the operator itself is holding the context: { field: "CompanyId", operator: "isnull" }

    Regards,
    Rosen
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
Back to Top
Kendo UI is VS 2017 Ready