Skip to content

Setting Filtering Expression Tree without condition function throws error if columns are not yet defined #15527

@skrustev

Description

@skrustev

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

  1. Open the grid-external-filtering demo
  2. Remove all cases where condition property is used and leave conditionName from filtering expression trees.
  3. Set columns to empty array
  4. Run the demo
  5. (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.

Metadata

Metadata

Type

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions