Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
skrustev opened this issue Mar 17, 2025 · 1 comment · May be fixed by #15523
Assignees
Labels
🐛 bug Any issue that describes a bug filtering 🧨 severity: medium version: 19.1.x ✅ status: resolved Applies to issues that have pending PRs resolving them, or PRs that have already merged.

Comments

@skrustev
Copy link
Member

skrustev commented Mar 17, 2025

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.

@skrustev skrustev added 🐛 bug Any issue that describes a bug 🆕 status: new labels Mar 17, 2025
@skrustev skrustev self-assigned this Mar 17, 2025
@skrustev skrustev added filtering 🛠️ status: in-development Issues and PRs with active development on them and removed 🆕 status: new labels Mar 17, 2025
@skrustev skrustev changed the title Setting Filtering Expression Tree without condition function throws error Setting Filtering Expression Tree without condition function throws error if columns are not yet defined Mar 17, 2025
@skrustev
Copy link
Member Author

Should be mostly resolved by #15506

@skrustev skrustev added ✅ status: resolved Applies to issues that have pending PRs resolving them, or PRs that have already merged. and removed 🛠️ status: in-development Issues and PRs with active development on them labels Mar 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Any issue that describes a bug filtering 🧨 severity: medium version: 19.1.x ✅ status: resolved Applies to issues that have pending PRs resolving them, or PRs that have already merged.
Projects
None yet
3 participants