Description
When specifying filteringExpression or advancedFilteringExpressionsTree, the user should be able to specify only conditionName per spec without the need for condition now. But if there are not columns yet defined for the grid it throws error, event if it works after the columns are added.
- igniteui-angular version: 19.1.x
- browser: any
Steps to reproduce
- Open the
grid-external-filtering demo
- Remove all cases where
condition property is used and leave conditionName from filtering expression trees.
- Set
columns to empty array
- Run the demo
- (optional) Add the columns using
setTimeout to delay them. This works if the error is not thrown/removed from code.
Result
The following error is thrown:
hook.js:608 ERROR Error: Wrong `conditionName`, `condition` or `field` provided!
at recreateExpression (expressions-tree-util.ts:153:15)
at recreateTreeFromFields (expressions-tree-util.ts:215:41)
at set advancedFilteringExpressionsTree (grid-base.directive.ts:1909:54)
at propDesc.set (watch-changes.ts:24:32)
at _GridExternalFilteringComponent.ngAfterViewInit (grid-external-filtering.sample.ts:41:20)
at callHookInternal (core.mjs:4195:10)
at callHook (core.mjs:4219:7)
at callHooks (core.mjs:4179:9)
at executeInitAndCheckHooks (core.mjs:4134:5)
at refreshView (core.mjs:13970:11)
Expected result
There should be no errors and should be able to use conditionName only initially before columns are set.
Description
When specifying
filteringExpressionoradvancedFilteringExpressionsTree, the user should be able to specify onlyconditionNameper spec without the need forconditionnow. But if there are notcolumnsyet defined for the grid it throws error, event if it works after the columns are added.Steps to reproduce
grid-external-filteringdemoconditionproperty is used and leaveconditionNamefrom filtering expression trees.columnsto empty arraysetTimeoutto delay them. This works if the error is not thrown/removed from code.Result
The following error is thrown:
Expected result
There should be no errors and should be able to use
conditionNameonly initially beforecolumnsare set.