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

filtering a field for nulls

3 Answers 2331 Views
Data Source
This is a migrated thread and some comments may be shown as answers.
Cecil
Top achievements
Rank 1
Cecil asked on 02 Apr 2016, 11:10 PM

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.

3 Answers, 1 is accepted

Sort by
0
Rosen
Telerik team
answered on 05 Apr 2016, 11:20 AM

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!
 
0
Cecil
Top achievements
Rank 1
answered on 05 Apr 2016, 08:24 PM

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

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

0
Rosen
Telerik team
answered on 06 Apr 2016, 11:08 AM

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!
 
Tags
Data Source
Asked by
Cecil
Top achievements
Rank 1
Answers by
Rosen
Telerik team
Cecil
Top achievements
Rank 1
Share this question
or