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
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
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