Grid throws if passed an expressionTree with a field name that does not exist in Grid. #15563
Labels
🐛 bug
Any issue that describes a bug
🔥 severity: high
grid: advanced-filtering
grid
✅ status: resolved
Applies to issues that have pending PRs resolving them, or PRs that have already merged.
Description
Grid supports accepting a FilteringExpressionsTree with missing logic function. The grid will recreate the logic based on the field it refers to.
However, if such field does not exist in the grid data, condition logic will not be recreated (Expected). Still, the grid will try to call condigion.logic without verifying it does exist
Steps to reproduce
Add grid
Pass the following filteringExpressionsTree:
grid.advancedFilteringExpressionsTree = JSON.parse('{"filteringOperands":[{"fieldName":"Missing","condition":{"name":"notEmpty","isUnary":true,"iconName":"filter_not_empty"},"conditionName":"notEmpty","ignoreCase":true,"searchVal":null,"searchTree":null}],"operator":0,"returnFields":[],"type":1}')
Grid throws:
cond.logic is not a function
Result
the filtering strategy should return false when trying to find a value in a field, which does not exist. Should try to call the condigion logic function to check a value.
Expected result
Grid should appear empty, because for every record, false would have been returned by the filtering strategy
AdvancedFilteringDialog should still display the filtering expression:
The text was updated successfully, but these errors were encountered: