Skip to content

Commit 1f35f2b

Browse files
committed
chore(*): Added checks to rehydrate on field/entity change
1 parent c6659eb commit 1f35f2b

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

projects/igniteui-angular/src/lib/grids/grid-base.directive.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6565,6 +6565,9 @@ export abstract class IgxGridBaseDirective implements GridType,
65656565
.filter((c) => c.pinned);
65666566
this._unpinnedColumns = newColumns.filter((c) => !c.pinned);
65676567
this._columns = newColumns;
6568+
if (this._columns) {
6569+
this._filteringExpressionsTree = recreateTreeFromFields(this._filteringExpressionsTree, this.columns) as IFilteringExpressionsTree;
6570+
}
65686571
this.resetCaches();
65696572
}
65706573

projects/igniteui-angular/src/lib/query-builder/query-builder.component.ts

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,26 @@ export class IgxQueryBuilderComponent implements OnDestroy {
5454
public showEntityChangeDialog = true;
5555

5656
/**
57-
* Gets/sets the entities.
57+
* Returns the entities.
58+
* @hidden
59+
*/
60+
public get entities(): EntityType[] {
61+
return this._entities;
62+
}
63+
64+
/**
65+
* Sets the entities.
66+
* @hidden
5867
*/
5968
@Input()
60-
public entities: EntityType[];
69+
public set entities(entities: EntityType[]) {
70+
this._entities = entities;
71+
if (JSON.stringify(entities) !== JSON.stringify(this._entities)) {
72+
if (this.entities && this.expressionTree) {
73+
this._expressionTree = recreateTree(this._expressionTree, this._entities);
74+
}
75+
}
76+
}
6177

6278
/**
6379
* Returns the fields.
@@ -162,6 +178,7 @@ export class IgxQueryBuilderComponent implements OnDestroy {
162178
private _resourceStrings = getCurrentResourceStrings(QueryBuilderResourceStringsEN);
163179
private _expressionTree: IExpressionTree;
164180
private _fields: FieldType[];
181+
private _entities: EntityType[];
165182

166183
constructor(protected iconService: IgxIconService) {
167184
this.registerSVGIcons();

0 commit comments

Comments
 (0)