Skip to content

feat(h-grid): update adv filtering schema on row expand - #15927

Open
igdmdimitrov wants to merge 12 commits into
masterfrom
dmdimitrov/hgrid-adv-filtering-schema
Open

igdmdimitrov wants to merge 12 commits into
masterfrom
dmdimitrov/hgrid-adv-filtering-schema

Conversation

@igdmdimitrov

@igdmdimitrov igdmdimitrov commented Jun 11, 2025

Copy link
Copy Markdown
Contributor

Closes #15827
Closes #15908

Additional information (check all that apply):

  • Bug fix
  • New functionality
  • Documentation
  • Demos
  • CI/CD

Checklist:

  • All relevant tags have been applied to this PR
  • This PR includes unit tests covering all the new code (test guidelines)
  • This PR includes API docs for newly added methods/properties (api docs guidelines)
  • This PR includes feature/README.MD updates for the feature docs
  • This PR includes general feature table updates in the root README.MD
  • This PR includes CHANGELOG.MD updates for newly added functionality
  • This PR contains breaking changes
  • This PR includes ng update migrations for the breaking changes (migrations guidelines)
  • This PR includes behavioral changes and the feature specification has been updated with them

@igdmdimitrov
igdmdimitrov requested a review from gedinakova June 17, 2025 07:38
@gedinakova

Copy link
Copy Markdown
Contributor

@igdmdimitrov There's an issue when expanding inner levels:

  1. Load HGrid Advanced Filtering dev demo
  2. Expand the first record, then its first child

Result: The following error is thrown in the console:
grid-base.directive.ts:7198 ERROR TypeError: Cannot set properties of undefined (setting 'fields')
at _IgxHierarchicalGridComponent.updateRootGridSchema (hierarchical-grid.component.ts:1292:25)
at Object.next (hierarchical-grid.component.ts:686:18)
at _IgxHierarchicalGridComponent.autogenerateColumns (grid-base.directive.ts:7198:35)

Expected result: No errors

@gedinakova

Copy link
Copy Markdown
Contributor

As currently setup, the AF dialog cannot be open in HGrid Advanced Filtering dev demo. The following console error is thrown:
ERROR TypeError: Cannot read properties of undefined (reading 'pipeArgs')
at _IgxQueryBuilderTreeComponent.getFormat (query-builder-tree.component.ts:1413:58)
at IgxQueryBuilderTreeComponent_ng_template_11_Conditional_0_Conditional_1_Conditional_10_Conditional_2_Conditional_1_Conditional_1_Template (query-builder-tree.component.html:211:45)
at executeTemplate (debug_node-Dn-GvQJo.mjs:7142:9)
at refreshView (debug_node-Dn-GvQJo.mjs:8887:13)
at detectChangesInView (debug_node-Dn-GvQJo.mjs:9107:9)
at detectChangesInViewIfAttached (debug_node-Dn-GvQJo.mjs:9067:5)
at detectChangesInEmbeddedViews (debug_node-Dn-GvQJo.mjs:9024:13)
at refreshView (debug_node-Dn-GvQJo.mjs:8916:9)
at detectChangesInView (debug_node-Dn-GvQJo.mjs:9107:9)
at detectChangesInViewIfAttached (debug_node-Dn-GvQJo.mjs:9067:5)

@gedinakova

Copy link
Copy Markdown
Contributor

@igdmdimitrov In the generateSchema method, please uncomment the label & header (I thought this was fixed at some point, but apparently not).
image

@igdmdimitrov
igdmdimitrov marked this pull request as ready for review July 7, 2025 07:51
@igdmdimitrov
igdmdimitrov requested a review from damyanpetev July 7, 2025 07:52

@gedinakova gedinakova left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need a Changelog update for this change.

@igdmdimitrov
igdmdimitrov requested a review from gedinakova July 17, 2025 05:44
gedinakova
gedinakova previously approved these changes Jul 17, 2025
@github-actions

Copy link
Copy Markdown

There has been no recent activity and this PR has been marked inactive.

@github-actions github-actions Bot added the status: inactive Used to stale issues and pull requests label Sep 16, 2025
@github-actions github-actions Bot closed this Sep 23, 2025
@igdmdimitrov igdmdimitrov reopened this Sep 23, 2025
@igdmdimitrov igdmdimitrov removed the status: inactive Used to stale issues and pull requests label Sep 23, 2025
Comment thread CHANGELOG.md Outdated
Co-authored-by: Galina Edinakova <gedinakova@infragistics.com>
gedinakova
gedinakova previously approved these changes Oct 14, 2025
@gedinakova gedinakova closed this Oct 14, 2025
@gedinakova gedinakova reopened this Oct 14, 2025
@github-actions

Copy link
Copy Markdown

There has been no recent activity and this PR has been marked inactive.

@github-actions github-actions Bot added the status: inactive Used to stale issues and pull requests label Dec 14, 2025
@github-actions github-actions Bot closed this Dec 22, 2025
@igdmdimitrov igdmdimitrov reopened this Dec 22, 2025
@igdmdimitrov igdmdimitrov removed the status: inactive Used to stale issues and pull requests label Dec 22, 2025
@github-actions

Copy link
Copy Markdown

There has been no recent activity and this PR has been marked inactive.

@github-actions github-actions Bot added the status: inactive Used to stale issues and pull requests label Feb 21, 2026
@github-actions github-actions Bot closed this Mar 1, 2026
@igdmdimitrov igdmdimitrov reopened this Mar 4, 2026
@igdmdimitrov igdmdimitrov removed the status: inactive Used to stale issues and pull requests label Mar 4, 2026
@github-actions

Copy link
Copy Markdown

There has been no recent activity and this PR has been marked inactive.

@github-actions github-actions Bot added the status: inactive Used to stale issues and pull requests label May 11, 2026
@igdmdimitrov igdmdimitrov removed the status: inactive Used to stale issues and pull requests label May 11, 2026
@github-actions

Copy link
Copy Markdown

There has been no recent activity and this PR has been marked inactive.

@github-actions github-actions Bot added the status: inactive Used to stale issues and pull requests label Jul 11, 2026

@damyanpetev damyanpetev left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not entirely sure all dynamic column scenarios are handled, though that might've been the case even before - generateSchema() is called only on init and for some reason when setting the expression tree. updateColumns/onColumnsChanged?
schema will likely benefit greatly being a computed() signal eventually (will make it lazy too), sadly don't think we have enough of the rest of the pieces there yet (columnList/childLayoutList).

And we'll need to update the deprecated versions :)

public set schema(entities: EntityType[]) {
this._hGridSchema = entities;
}
public set schema(entities: EntityType[]) {}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A bit iffy on the setter being noop - while it's doubtful that its seen major usage, ideally we'd have it fully functional until its removed.
Otherwise, at least make sure whatever scenario this prop was meant to support, that even with the inactive setter doesn't change with the new functionality handling schema internally.

this.batchEditing = val;
});
}
this.columnsAutogenerated.subscribe((e) => {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With pipe(takeUntilDestroyed()) like other subs?

}

private generateChildEntity(rowIsland: IgxRowIslandComponent, firstRowData: any[]): EntityType {
private updateRootGridSchema(event: any) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm sure the even has a type, other than any

defaultTimeFormat: f.defaultTimeFormat,
defaultDateTimeFormat: f.defaultDateTimeFormat
})) as FieldType[];
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While the optimization for a single path update sounds nice, grid setups rarely changes w/ high frequency and the structures being processed are rarely, but sure - I can recall a few massive column lists, but even those are likely in the 100s, which is nothing much for list.

Regardless, two questions about this:

  • This logic is more/less a repeat of the one in generateSchema()? If so, would be nice if those are either combined, reused or otherwise refactored into a single thing that does the islands/columns -> entity/fields mapping
  • And isn't the column directly compatible with FieldType? Does the QB modify something in the schema fields? Otherwise, I wonder why not just take the filtered columns directly?

@damyanpetev damyanpetev removed the status: inactive Used to stale issues and pull requests label Jul 13, 2026
@dkamburov dkamburov self-assigned this Jul 16, 2026
Copilot AI review requested due to automatic review settings July 30, 2026 07:06
@igdmdimitrov igdmdimitrov added 🛠️ status: in-development Issues and PRs with active development on them and removed 💥 status: in-test PRs currently being tested labels Jul 30, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses Hierarchical Grid advanced filtering schema generation for nested layouts (notably when child data is missing) by avoiding schema inference from the first record and instead updating the generated schema when row islands expand/auto-generate their columns. It also introduces a deprecation note for the schema input and adjusts tests and changelog accordingly.

Changes:

  • Deprecates the IgxHierarchicalGridComponent.schema input and shifts schema updates to occur when row islands expand (columns auto-generate).
  • Updates schema generation to avoid reading nested child data from the first record (prevents runtime errors when data is missing).
  • Updates the advanced filtering spec to validate schema updates after row island expansion; updates the changelog; makes getFormat safer.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
projects/igniteui-angular/query-builder/src/query-builder/query-builder-tree.component.ts Adjusts query builder formatting retrieval to be more null-safe.
projects/igniteui-angular/grids/hierarchical-grid/src/hierarchical-grid.component.ts Deprecates schema input behavior, changes schema generation for child entities, and adds root schema updates on column auto-generation.
projects/igniteui-angular/grids/grid/src/grid-filtering-advanced.spec.ts Reworks a test to validate schema updates after row island expansion (advanced filtering UI).
CHANGELOG.md Documents the IgxHierarchicalGrid.schema deprecation.

Comment on lines 1382 to 1384
public getFormat(field: string) {
return this.fields?.find(el => el.field === field).pipeArgs.format;
return this.fields?.find(el => el.field === field)?.pipeArgs.format;
}
Comment on lines 549 to 553
* const schema = this.grid.schema;
* this.grid.schema = [{ name: 'Products', fields: [...], childEntities: [...] }];
* ```
* @deprecated in version 20.2.0.
*/
Comment on lines 554 to 556
@Input()
public set schema(entities: EntityType[]) {
this._hGridSchema = entities;
}
public set schema(entities: EntityType[]) {}

Comment on lines +1306 to +1310
let childEntity = schema[0];
for (let i = 0; i < path.length; i++) {
childEntity = childEntity.childEntities.find(e => e.name === path[i]);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

5 participants