ODATA: filterColumn eq null results in wrong query filter

Hi,

there is a possible issue using filterByColumn and OData when the value filtered should be null. I followed the following tutorial Filtering in Angular Grid component - Syncfusion

filterTest: IFilter = { ui: {   [...]     read: (args: { target: Element, column: any, operator: string, fltrObj: Filter }) => {

      args.fltrObj.filterByColumn(args.column.field, args.operator, null);
    }
  }
};

The resulting query contains the following filter

$filter=((COLUMNNAME%20eq%20undefined)%20or%20(COLUMNNAME%20eq%20null))

which is not correct. It should be

$filter=(COLUMNNAME%20eq%20null)

and no query for undefined


7 Replies

SK Sujith Kumar Rajkumar Syncfusion Team December 20, 2021 12:55 PM UTC

Hi Michael, 
 
Greetings from Syncfusion support. 
 
We could reproduce the reported issue from our end and have logged defect report for the same as – “Filtering bug with OData adaptor”. At Syncfusion, we are committed to fixing all validated defects (subject to technological feasibility and Product Development Life Cycle ) and will include the defect fix in our patch release scheduled on 5th January 2022. We appreciate your patience until then. 
 
You can now track the current status of your request, review the proposed resolution timeline, and contact us for any further inquiries through the below link, 
 
 
Regards, 
Sujith R 



PS Pavithra Subramaniyam Syncfusion Team January 6, 2022 10:20 AM UTC

Hi Michael, 
 
Due to some complexities with this issue, we could not include the fix as promised. We are currently working on it with high priority and will include it in our weekly patch release scheduled on 19th January 2022. 
 
We apologize for the inconvenience caused and appreciate your patience until then. 
 
Regards, 
Pavithra S 



PS Pavithra Subramaniyam Syncfusion Team January 19, 2022 12:14 PM UTC

Hi Michael, 
 
Thanks for your patience.  
 
We are glad to announce that we have added the fix for the issue –“ Filtering bug with OData adaptor” in our patch release (v19.4.42). So please update your packages to this version/latest version to include the fix.  
 
 
We thank you for your support and appreciate your patience in waiting for this release. Please contact us if you would require any further assistance.  
 
Regards,  
Pavithra S  



MM Michael Mairegger January 20, 2022 10:23 AM UTC

Hi Pavithra,

I can confirm that the bug is fixes.

I have just one note: the filterByColumn method takes string | number | Date | boolean | number[] | string[] | Date[] | boolean[]​ as filterValue parameter. Because I have strict mode on, the method does not allow passing null. As workaround i use the null-forgiving operator on null. 

args.fltrObj.filterByColumn(args.column.field, args.operator, null!)

It would be cool to extend the filterValue with | null


Regards,
Michael



PS Pavithra Subramaniyam Syncfusion Team January 21, 2022 12:48 PM UTC

Hi Michael, 
We have validated your query and we have confirmed it as a bug and logged the defect report Lint error while passing null value in filterByColumn method” for the same. Thank you for taking the time to report this issue and helping us improve our product. At Syncfusion, we are committed to fixing all validated defects (subject to technological feasibility and Product Development Life Cycle) and including the defect fix in our weekly release which is expected to be rolled out by the February 02nd , 2021.  
           
You can now track the current status of your request, review the proposed resolution timeline, and contact us for any further inquiries through this link.     


Regards, 
Pavithra S 



PS Pavithra Subramaniyam Syncfusion Team February 7, 2022 12:50 PM UTC

Hi Michael, 
 
Sorry for the inconvenience. 
 
Due to some complexities, the reported issue Lint error while passing null value in filterByColumn methodwill be included on our upcoming February 9th, 2022, patch release. Until then we appreciate your patience. 
 
Regards, 
Pavithra S 



PS Pavithra Subramaniyam Syncfusion Team April 6, 2022 06:20 AM UTC

Hi Michael,  


Thanks for your patience. 


We are glad to announce that we have added the fix for the issue –“Lint error while passing null value in filterByColumn method” in our patch release (v19.4.52). So please update your packages to the latest version to include the fix. 


Release Notes: https://ej2.syncfusion.com/angular/documentation/release-notes/19.4.52/?type=all#grid   

We thank you for your support and appreciate your patience in waiting for this release. Please contact us if you would require any further assistance. 


Regards, 

Pavithra S 


Loader.
Up arrow icon