Skip to content

feat(h-grid): add support for advanced filtering #15562

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

Merged
merged 66 commits into from
Apr 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
3374ac5
feat(h-grid): advanced filtering POC with sample
igdmdimitrov Mar 21, 2025
0d60679
Merge branch 'master' into dmdimitrov/hgrid-advanced-filtering
igdmdimitrov Mar 21, 2025
878981e
feat(h-grid): hide return fields select/combo in advanced filtering
igdmdimitrov Mar 27, 2025
1d55057
Merge branch 'master' into dmdimitrov/hgrid-advanced-filtering
igdmdimitrov Mar 27, 2025
72ad1d4
Merge branch 'master' into dmdimitrov/hgrid-advanced-filtering
teodosiah Mar 28, 2025
60e1b0a
test(AF): refactor AF rehydration describe
teodosiah Mar 28, 2025
6824a86
fix(hgrid): Cannot access 'IgxGridBaseDirective' before initialization
teodosiah Mar 28, 2025
a9f8e33
test(AF): add tests for QB in hgrid AF
teodosiah Mar 31, 2025
edcb401
fix(query-builder): commit expressions properly in hgrid
teodosiah Mar 31, 2025
ae5062e
fix(query-builder): get proper condition list for AF & QB
teodosiah Mar 31, 2025
237ec54
Merge branch 'master' into dmdimitrov/hgrid-advanced-filtering
teodosiah Mar 31, 2025
04d0496
chore(*): fix selected field filters
igdmdimitrov Mar 31, 2025
69fe521
chore(*): fix adv filtering check and set selected field pipeArgs
igdmdimitrov Apr 1, 2025
2f41c93
chore(*): fix selected field pipeArgs
igdmdimitrov Apr 1, 2025
b846588
feat(h-grid): support notInQuery in adv filtering
igdmdimitrov Apr 1, 2025
a7bac6f
feat(h-grid): adv filtering improvements for load on demand
igdmdimitrov Apr 2, 2025
502b9c1
Merge branch 'master' into dmdimitrov/hgrid-advanced-filtering
igdmdimitrov Apr 7, 2025
3205fd8
fix(h-grid): set more fields props in entities
igdmdimitrov Apr 7, 2025
874359d
feat(h-grid): set remote entities for advanced filtering
igdmdimitrov Apr 9, 2025
73f9e8c
Merge branch 'master' into dmdimitrov/hgrid-advanced-filtering
igdmdimitrov Apr 9, 2025
becee5a
chore(*): fix sample when filtering is cleared
igdmdimitrov Apr 9, 2025
87fc940
feat(h-grid): set filtering entities and fix rehydration
igdmdimitrov Apr 10, 2025
87eb2de
Merge branch 'master' into dmdimitrov/hgrid-advanced-filtering
igdmdimitrov Apr 10, 2025
1266803
feat(h-grid): prop rename and return first field if returnFields is e…
igdmdimitrov Apr 10, 2025
7612948
feat(h-grid): add fields for child entities and not show select entit…
igdmdimitrov Apr 10, 2025
a4b4c74
chore(*): revert filed name change
igdmdimitrov Apr 10, 2025
4beb821
test(h-grid): fix childData and undefined errors in tests
teodosiah Apr 11, 2025
f96f349
test(h-grid): fix test failing due to UI changes
teodosiah Apr 11, 2025
9e6e421
test(h-grid): fix failing QB tests
teodosiah Apr 11, 2025
04e5711
feat(h-grid): revert creating fields for each child entity
igdmdimitrov Apr 11, 2025
595c3cb
feat(h-grid): set expected return field in nested query and select if…
igdmdimitrov Apr 11, 2025
6316199
chore(*): fix filtering when child grid is empty
igdmdimitrov Apr 11, 2025
fb358ff
test(h-grid): fix duplicated fields issue
teodosiah Apr 11, 2025
1bb5055
chore(*): fix selection of expected return field
igdmdimitrov Apr 11, 2025
c98652b
Merge branch 'dmdimitrov/hgrid-advanced-filtering' of https://github.…
igdmdimitrov Apr 11, 2025
53c4f44
fix(QB): Removed unneeded check in operandCanBeCommitted().
gedinakova Apr 11, 2025
1d384c6
chore(*): fix timing of schema generation
igdmdimitrov Apr 11, 2025
ca4eade
Merge branch 'dmdimitrov/hgrid-advanced-filtering' of https://github.…
igdmdimitrov Apr 11, 2025
15619b5
fix(*): QB test failure caused by preselection of matching field
gedinakova Apr 11, 2025
c7eba29
Merge branch 'dmdimitrov/hgrid-advanced-filtering' of https://github.…
gedinakova Apr 11, 2025
bf41866
test(h-grid): fix failing tests due to UI changes
teodosiah Apr 11, 2025
2cd36b4
feat(h-grid): update changelog and documentation comment
igdmdimitrov Apr 14, 2025
c80b486
test(h-grid): check default value of inner query return fields
teodosiah Apr 14, 2025
955f75b
Merge branch 'dmdimitrov/hgrid-advanced-filtering' of https://github.…
teodosiah Apr 14, 2025
0c0b0ac
Merge branch 'master' into dmdimitrov/hgrid-advanced-filtering
gedinakova Apr 14, 2025
8916747
Update CHANGELOG.md
igdmdimitrov Apr 14, 2025
f90fa21
fix(h-grid): select proper return field when there is single child en…
teodosiah Apr 14, 2025
9995478
Merge branch 'dmdimitrov/hgrid-advanced-filtering' of https://github.…
teodosiah Apr 14, 2025
c9a65cd
chore(*): trigger schema generation
igdmdimitrov Apr 14, 2025
89d444f
Merge branch 'dmdimitrov/hgrid-advanced-filtering' of https://github.…
igdmdimitrov Apr 14, 2025
c6fddcc
chore(*): fix circular dependency
igdmdimitrov Apr 14, 2025
972e400
test(h-grid): add LOD schema prop test
teodosiah Apr 14, 2025
d7cdc51
test(h-grid): update describe imports
teodosiah Apr 14, 2025
49a1868
Merge branch 'master' into dmdimitrov/hgrid-advanced-filtering
teodosiah Apr 15, 2025
ce2b943
test(h-grid): add check for JSON parsed expression tree
teodosiah Apr 15, 2025
9f0d8c6
chore(*): fix clear filter not showing add condition option
igdmdimitrov Apr 15, 2025
7fca3c7
Merge branch 'dmdimitrov/hgrid-advanced-filtering' of https://github.…
igdmdimitrov Apr 15, 2025
d1d7acc
chore(*): address comments and other fixes
igdmdimitrov Apr 15, 2025
270ac2b
feat(h-grid): fixed adv filtering for date and time columns on nested…
igdmdimitrov Apr 15, 2025
aa7c347
chore(*): added null check for dataType
igdmdimitrov Apr 15, 2025
b71d5a2
chore(*): renamed method to isHierarchicalNestedQuery
igdmdimitrov Apr 15, 2025
6a5c88d
chore(*): renamed method to isHierarchicalNestedQuery
igdmdimitrov Apr 15, 2025
d6cb157
chore(*): regenerated elements config
igdmdimitrov Apr 15, 2025
a4642c2
Update projects/igniteui-angular/src/lib/data-operations/filtering-st…
igdmdimitrov Apr 15, 2025
4b619ed
chore(*): Fixed a typo in changelog
gedinakova Apr 15, 2025
fad898b
Merge branch 'dmdimitrov/hgrid-advanced-filtering' of https://github.…
gedinakova Apr 15, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ All notable changes for each version of this project will be documented in this
- A column's `minWidth` and `maxWidth` constrain the user-specified `width` so that it cannot go outside their bounds.
- In SSR mode grid with height 100% or with no height will render on the server with % size and with no data. The grid will show either the empty grid template or the loading indicator (if isLoading is true).
- In SSR mode grid with width 100% or with no width will render on the server with % size and with all columns.
- `IgxHierarchicalGrid`
- Introduced a new advanced filtering capability that enables top-level records to be dynamically refined based on the attributes or data of their associated child records.
- Added a new `schema` input property that can be used to pass collection of `EntityType` objects. This property is required for remote data scenarios.
- `IgxQueryBuilderComponent`, `IgxAdvancedFilteringDialogComponent`
- Added support for entities with hierarchical structure.
- `EntityType`
- A new optional property called `childEntities` has been introduced that can be used to create nested entities.

## 19.1.1
### New Features
Expand All @@ -30,7 +37,7 @@ All notable changes for each version of this project will be documented in this
- Introduced a new `expanded` input property, enabling dynamic control over the banner's state. The banner can now be programmatically set to expanded (visible) or collapsed (hidden) both initially and at runtime. Animations will trigger during runtime updates — the **open animation** plays when `expanded` is set to `true`, and the **close animation** plays when set to `false`. However, no animations will trigger when the property is set initially.
- The banner's event lifecycle (`opening`, `opened`, `closing`, `closed`) only triggers through **user interactions** (e.g., clicking to open/close). Programmatic updates using the `expanded` property will not fire any events.
- If the `expanded` property changes during an ongoing animation, the current animation will **stop** and the opposite animation will begin from the **point where the previous animation left off**. For instance, if the open animation (10 seconds) is interrupted at 6 seconds and `expanded` is set to `false`, the close animation (5 seconds) will start from its 3rd second.
- `IgxQueryBuilder` has new design that comes with updated appearance and new functionality
- `IgxQueryBuilder` has a new design that comes with an updated appearance and new functionality
- `IgxQueryBuilderComponent`
- Introduced the ability to create nested queries by specifying IN/NOT IN operators.
- Introduced the ability to reposition condition chips by dragging or using `Arrow Up/Down`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,20 @@ import {
} from "../../../igniteui-angular/src/public_api";
import { IgxPaginatorComponent } from "../../../igniteui-angular/src/lib/paginator/paginator.component";
import { IgxPaginatorToken } from "../../../igniteui-angular/src/lib/paginator/token";
import { IgxActionStripComponent } from "../../../igniteui-angular/src/lib/action-strip/action-strip.component";
import { IgxActionStripToken } from "../../../igniteui-angular/src/lib/action-strip/token";
import { IgxGridEditingActionsComponent } from "../../../igniteui-angular/src/lib/action-strip/grid-actions/grid-editing-actions.component";
import { IgxGridActionsBaseDirective } from "../../../igniteui-angular/src/lib/action-strip/grid-actions/grid-actions-base.directive";
import { IgxGridPinningActionsComponent } from "../../../igniteui-angular/src/lib/action-strip/grid-actions/grid-pinning-actions.component";
import { IgxColumnComponent } from "../../../igniteui-angular/src/lib/grids/columns/column.component";
import { IgxColumnGroupComponent } from "../../../igniteui-angular/src/lib/grids/columns/column-group.component";
import { IgxColumnLayoutComponent } from "../../../igniteui-angular/src/lib/grids/columns/column-layout.component";
import { IgxGridToolbarTitleComponent } from "../../../igniteui-angular/src/lib/grids/toolbar/common";
import { IgxGridToolbarActionsComponent } from "../../../igniteui-angular/src/lib/grids/toolbar/common";
import { IgxGridToolbarAdvancedFilteringComponent } from "../../../igniteui-angular/src/lib/grids/toolbar/grid-toolbar-advanced-filtering.component";
import { IgxGridToolbarComponent } from "../../../igniteui-angular/src/lib/grids/toolbar/grid-toolbar.component";
import { IgxToolbarToken } from "../../../igniteui-angular/src/lib/grids/toolbar/token";
import { IgxColumnComponent } from "../../../igniteui-angular/src/lib/grids/columns/column.component";
import { IgxColumnGroupComponent } from "../../../igniteui-angular/src/lib/grids/columns/column-group.component";
import { IgxRowIslandComponent } from "../../../igniteui-angular/src/lib/grids/hierarchical-grid/row-island.component";
import { IgxActionStripComponent } from "../../../igniteui-angular/src/lib/action-strip/action-strip.component";
import { IgxActionStripToken } from "../../../igniteui-angular/src/lib/action-strip/token";
import { IgxGridEditingActionsComponent } from "../../../igniteui-angular/src/lib/action-strip/grid-actions/grid-editing-actions.component";
import { IgxGridActionsBaseDirective } from "../../../igniteui-angular/src/lib/action-strip/grid-actions/grid-actions-base.directive";
import { IgxGridPinningActionsComponent } from "../../../igniteui-angular/src/lib/action-strip/grid-actions/grid-pinning-actions.component";
import { IgxColumnLayoutComponent } from "../../../igniteui-angular/src/lib/grids/columns/column-layout.component";
import { IgxGridToolbarExporterComponent } from "../../../igniteui-angular/src/lib/grids/toolbar/grid-toolbar-exporter.component";
import { IgxGridToolbarHidingComponent } from "../../../igniteui-angular/src/lib/grids/toolbar/grid-toolbar-hiding.component";
import { IgxGridToolbarPinningComponent } from "../../../igniteui-angular/src/lib/grids/toolbar/grid-toolbar-pinning.component";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,16 +178,17 @@ export function isTree(entry: IExpressionTree | IFilteringExpression): entry is
* @param entities An array of entities to use for recreating the tree.
* @returns The recreated expression tree.
*/
export function recreateTree(tree: IExpressionTree, entities: EntityType[]): IExpressionTree {
const entity = entities.find(e => e.name === tree.entity);
export function recreateTree(tree: IExpressionTree, entities: EntityType[], isRoot: boolean = false): IExpressionTree {
const entity = isRoot ? entities[0] : entities.find(e => e.name === tree.entity);
if (!entity) return tree;

for (let i = 0; i < tree.filteringOperands.length; i++) {
const operand = tree.filteringOperands[i];
if (isTree(operand)) {
tree.filteringOperands[i] = recreateTree(operand, entities);
} else {
if (operand.searchTree) {
operand.searchTree = recreateTree(operand.searchTree, entities);
operand.searchTree = recreateTree(operand.searchTree, entities[0].childEntities ?? entities);
}
tree.filteringOperands[i] = recreateExpression(operand, entity?.fields);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import { FilteringLogic, IFilteringExpression } from './filtering-expression.interface';
import { FilteringExpressionsTree, IFilteringExpressionsTree } from './filtering-expressions-tree';
import { resolveNestedPath, parseDate, formatDate, formatCurrency } from '../core/utils';
import { ColumnType, GridType } from '../grids/common/grid.interface';
import { ColumnType, EntityType, GridType } from '../grids/common/grid.interface';
import { GridColumnDataType } from './data-util';
import { SortingDirection } from './sorting-strategy';
import { formatNumber, formatPercent, getLocaleCurrencyCode } from '@angular/common';
import { IFilteringState } from './filtering-state.interface';
import { isTree } from './expressions-tree-util';
import { IgxHierarchicalGridComponent } from '../grids/hierarchical-grid/hierarchical-grid.component';

const DateType = 'date';
const DateTimeType = 'dateTime';
Expand Down Expand Up @@ -39,14 +40,34 @@ export interface IgxFilterItem {
export abstract class BaseFilteringStrategy implements IFilteringStrategy {
// protected
public findMatchByExpression(rec: any, expr: IFilteringExpression, isDate?: boolean, isTime?: boolean, grid?: GridType): boolean {
if (expr.searchTree) {
const records = rec[expr.searchTree.entity];
const shouldMatchRecords = expr.conditionName === 'inQuery';
if (!records) { // child grid is not yet created
return true;
} else if (records.length === 0) { // child grid is empty
return false;
}

for (let index = 0; index < records.length; index++) {
const record = records[index];
if ((shouldMatchRecords && this.matchRecord(record, expr.searchTree, grid, expr.searchTree.entity)) ||
(!shouldMatchRecords && !this.matchRecord(record, expr.searchTree, grid, expr.searchTree.entity))) {
return true;
}
}

return false;
}

const val = this.getFieldValue(rec, expr.fieldName, isDate, isTime, grid);
if (expr.condition?.logic) {
return expr.condition.logic(val, expr.searchVal, expr.ignoreCase);
}
}

// protected
public matchRecord(rec: any, expressions: IFilteringExpressionsTree | IFilteringExpression, grid?: GridType): boolean {
public matchRecord(rec: any, expressions: IFilteringExpressionsTree | IFilteringExpression, grid?: GridType, entity?: string): boolean {
if (expressions) {
if (isTree(expressions)) {
const expressionsTree = expressions;
Expand All @@ -55,7 +76,7 @@ export abstract class BaseFilteringStrategy implements IFilteringStrategy {

if (expressionsTree.filteringOperands && expressionsTree.filteringOperands.length) {
for (const operand of expressionsTree.filteringOperands) {
matchOperand = this.matchRecord(rec, operand, grid);
matchOperand = this.matchRecord(rec, operand, grid, entity);

// Return false if at least one operand does not match and the filtering logic is And
if (!matchOperand && operator === FilteringLogic.And) {
Expand All @@ -74,16 +95,42 @@ export abstract class BaseFilteringStrategy implements IFilteringStrategy {
return true;
} else {
const expression = expressions;
const column = grid && grid.getColumnByName(expression.fieldName);
const isDate = column ? column.dataType === DateType || column.dataType === DateTimeType : false;
const isTime = column ? column.dataType === TimeType : false;
let dataType = null;
if (!entity) {
const column = grid && grid.getColumnByName(expression.fieldName);
dataType = column?.dataType;
} else if (grid.type === 'hierarchical') {
const schema = (grid as IgxHierarchicalGridComponent).schema;
const entityMatch = this.findEntityByName(schema, entity);
dataType = entityMatch?.fields.find(f => f.field === expression.fieldName)?.dataType;
}

const isDate = dataType ? dataType === DateType || dataType === DateTimeType : false;
const isTime = dataType ? dataType === TimeType : false;

return this.findMatchByExpression(rec, expression, isDate, isTime, grid);
}
}

return true;
}

private findEntityByName(schema: EntityType[], name: string): EntityType | null {
for (const entity of schema) {
if (entity.name === name) {
return entity;
}

if (entity.childEntities && entity.childEntities.length > 0) {
const found = this.findEntityByName(entity.childEntities, name);
if (found) {
return found;
}
}
}
return null;
}

public getFilterItems(column: ColumnType, tree: IFilteringExpressionsTree): Promise<IgxFilterItem[]> {

let data = column.grid.gridAPI.filterDataByExpressions(tree);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1497,4 +1497,5 @@ export interface IClipboardOptions {
export interface EntityType {
name: string;
fields: FieldType[];
childEntities?: EntityType[];
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { IDragStartEventArgs, IgxDragDirective, IgxDragHandleDirective } from '.
import { Subject } from 'rxjs';
import { IActiveNode } from '../../grid-navigation.service';
import { PlatformUtil } from '../../../core/utils';
import { FieldType, GridType } from '../../common/grid.interface';
import { EntityType, FieldType, GridType } from '../../common/grid.interface';
import { IgxQueryBuilderComponent } from '../../../query-builder/query-builder.component';
import { GridResourceStringsEN } from '../../../core/i18n/grid-resources';
import { IFilteringExpressionsTree } from '../../../data-operations/filtering-expressions-tree';
Expand All @@ -15,6 +15,8 @@ import { IgxQueryBuilderHeaderComponent } from '../../../query-builder/query-bui
import { NgClass } from '@angular/common';
import { getCurrentResourceStrings } from '../../../core/i18n/resources';
import { QueryBuilderResourceStringsEN } from '../../../core/i18n/query-builder-resources';
import { IgxHierarchicalGridComponent } from '../../hierarchical-grid/hierarchical-grid.component';
import { IgxRowIslandComponent } from '../../hierarchical-grid/row-island.component';

/**
* A component used for presenting advanced filtering UI for a Grid.
Expand Down Expand Up @@ -191,18 +193,33 @@ export class IgxAdvancedFilteringDialogComponent implements AfterViewInit, OnDes
this.closeDialog();
}


/**
* @hidden @internal
*/
public generateEntity() {
const entities = [
{
name: null,
fields: this.filterableFields
}
];
return entities;
if (this.queryBuilder?.entities) {
return this.queryBuilder?.entities;
} else if (this.grid.type === 'hierarchical') {
return (this.grid as IgxHierarchicalGridComponent).schema;
} else {
const entities: EntityType[] = [
{
name: null,
fields: this.filterableFields.map(f => ({
field: f.field,
dataType: f.dataType,
// label: f.label,
// header: f.header,
editorOptions: f.editorOptions,
filters: f.filters,
pipeArgs: f.pipeArgs,
defaultTimeFormat: f.defaultTimeFormat,
defaultDateTimeFormat: f.defaultDateTimeFormat
})) as FieldType[]
}
];
return entities;
}
}

private assignResourceStrings() {
Expand Down
26 changes: 18 additions & 8 deletions projects/igniteui-angular/src/lib/grids/grid-base.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,8 @@ import {
ISizeInfo,
RowType,
IPinningConfig,
IClipboardOptions
IClipboardOptions,
EntityType
} from './common/grid.interface';
import { DropPosition } from './moving/moving.service';
import { IgxHeadSelectorDirective, IgxRowSelectorDirective } from './selection/row-selectors';
Expand Down Expand Up @@ -179,7 +180,7 @@ import { DefaultDataCloneStrategy, IDataCloneStrategy } from '../data-operations
import { IgxGridCellComponent } from './cell.component';
import { IgxGridValidationService } from './grid/grid-validation.service';
import { getCurrentResourceStrings } from '../core/i18n/resources';
import { isTree, recreateTreeFromFields } from '../data-operations/expressions-tree-util';
import { isTree, recreateTree, recreateTreeFromFields } from '../data-operations/expressions-tree-util';
import { getUUID } from './common/random';

interface IMatchInfoCache {
Expand Down Expand Up @@ -1859,7 +1860,7 @@ export abstract class IgxGridBaseDirective implements GridType,

value.type = FilteringExpressionsTreeType.Regular;
if (value && this._columns?.length > 0) {
this._filteringExpressionsTree = recreateTreeFromFields(value, this._columns) as IFilteringExpressionsTree;
this._filteringExpressionsTree = this.getRecreatedTree(value);
} else {
this._filteringExpressionsTree = value;
}
Expand Down Expand Up @@ -1909,7 +1910,7 @@ export abstract class IgxGridBaseDirective implements GridType,
if (value && isTree(value)) {
value.type = FilteringExpressionsTreeType.Advanced;
if (this._columns && this._columns.length > 0) {
this._advancedFilteringExpressionsTree = recreateTreeFromFields(value, this._columns) as IFilteringExpressionsTree;
this._advancedFilteringExpressionsTree = this.getRecreatedTree(value);
} else {
this._advancedFilteringExpressionsTree = value;
}
Expand Down Expand Up @@ -3138,6 +3139,7 @@ export abstract class IgxGridBaseDirective implements GridType,
matchCount: 0,
content: ''
};
protected _hGridSchema: EntityType[];
protected gridComputedStyles;

/** @hidden @internal */
Expand Down Expand Up @@ -6638,10 +6640,10 @@ export abstract class IgxGridBaseDirective implements GridType,
this._unpinnedColumns = newColumns.filter((c) => !c.pinned);
this._columns = newColumns;
if (this._columns && this._columns.length && this._filteringExpressionsTree) {
this._filteringExpressionsTree = recreateTreeFromFields(this._filteringExpressionsTree, this.columns) as IFilteringExpressionsTree;
this._filteringExpressionsTree = this.getRecreatedTree(this._filteringExpressionsTree);
}
if (this._columns && this._columns.length && this._advancedFilteringExpressionsTree) {
this._advancedFilteringExpressionsTree = recreateTreeFromFields(this._advancedFilteringExpressionsTree, this.columns) as IFilteringExpressionsTree;
this._advancedFilteringExpressionsTree = this.getRecreatedTree(this._advancedFilteringExpressionsTree);
}
this.resetCaches();
}
Expand Down Expand Up @@ -6706,10 +6708,10 @@ export abstract class IgxGridBaseDirective implements GridType,
this._columns = this.getColumnList();
}
if (this._columns && this._columns.length && this._filteringExpressionsTree) {
this._filteringExpressionsTree = recreateTreeFromFields(this._filteringExpressionsTree, this._columns) as IFilteringExpressionsTree;
this._filteringExpressionsTree = this.getRecreatedTree(this._filteringExpressionsTree);
}
if (this._columns && this._columns.length && this._advancedFilteringExpressionsTree) {
this._advancedFilteringExpressionsTree = recreateTreeFromFields(this._advancedFilteringExpressionsTree, this._columns) as IFilteringExpressionsTree;
this._advancedFilteringExpressionsTree = this.getRecreatedTree(this._advancedFilteringExpressionsTree);
}

this.initColumns(this._columns, (col: IgxColumnComponent) => this.columnInit.emit(col));
Expand Down Expand Up @@ -7922,4 +7924,12 @@ export abstract class IgxGridBaseDirective implements GridType,
this.navigation.activeNode = {} as IActiveNode;
this.notifyChanges();
}

private getRecreatedTree(value: IFilteringExpressionsTree): IFilteringExpressionsTree {
if (this._hGridSchema) {
return recreateTree(value, this._hGridSchema, true) as IFilteringExpressionsTree;
} else {
return recreateTreeFromFields(value, this._columns) as IFilteringExpressionsTree;
}
}
}
Loading
Loading