Skip to content

Commit 796cf99

Browse files
authored
Merge branch '10.1.x' into dTsvetkov/fix-issue-8320-10.1.x
2 parents 14b5d11 + b8e2705 commit 796cf99

File tree

2 files changed

+27
-11
lines changed

2 files changed

+27
-11
lines changed

projects/igniteui-angular/src/lib/grids/filtering/excel-style/grid.excel-style-filtering.component.ts

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ export class IgxGridExcelStyleFilteringComponent implements OnDestroy {
125125
this._columnPinning = this.grid.onColumnPinning.pipe(takeUntil(this.destroy$)).subscribe(() => {
126126
requestAnimationFrame(() => {
127127
if (!(this.cdr as ViewRef).destroyed) {
128-
this.cdr.detectChanges();
128+
this.cdr.detectChanges();
129129
}
130130
});
131131
});
@@ -189,7 +189,7 @@ export class IgxGridExcelStyleFilteringComponent implements OnDestroy {
189189
*/
190190
@Input()
191191
get minHeight(): string {
192-
if (this._minHeight || this._minHeight === 0) {
192+
if (this._minHeight || this._minHeight === 0) {
193193
return this._minHeight;
194194
}
195195

@@ -406,20 +406,20 @@ export class IgxGridExcelStyleFilteringComponent implements OnDestroy {
406406
private areExpressionsSelectable () {
407407
if (this.expressionsList.length === 1 &&
408408
(this.expressionsList[0].expression.condition.name === 'equals' ||
409-
this.expressionsList[0].expression.condition.name === 'true' ||
410-
this.expressionsList[0].expression.condition.name === 'false' ||
411-
this.expressionsList[0].expression.condition.name === 'empty' ||
412-
this.expressionsList[0].expression.condition.name === 'in')) {
409+
this.expressionsList[0].expression.condition.name === 'true' ||
410+
this.expressionsList[0].expression.condition.name === 'false' ||
411+
this.expressionsList[0].expression.condition.name === 'empty' ||
412+
this.expressionsList[0].expression.condition.name === 'in')) {
413413
return true;
414414
}
415415

416416
const selectableExpressionsCount = this.expressionsList.filter(exp =>
417417
(exp.beforeOperator === 1 || exp.afterOperator === 1) &&
418418
(exp.expression.condition.name === 'equals' ||
419-
exp.expression.condition.name === 'true' ||
420-
exp.expression.condition.name === 'false' ||
421-
exp.expression.condition.name === 'empty' ||
422-
exp.expression.condition.name === 'in')).length;
419+
exp.expression.condition.name === 'true' ||
420+
exp.expression.condition.name === 'false' ||
421+
exp.expression.condition.name === 'empty' ||
422+
exp.expression.condition.name === 'in')).length;
423423

424424
return selectableExpressionsCount === this.expressionsList.length;
425425
}
@@ -459,7 +459,12 @@ export class IgxGridExcelStyleFilteringComponent implements OnDestroy {
459459
this.loadingStart.emit();
460460
const expressionsTree: FilteringExpressionsTree = this.getColumnFilterExpressionsTree();
461461

462+
const prevColumn = this.column;
462463
this.grid.uniqueColumnValuesStrategy(this.column, expressionsTree, (colVals: any[]) => {
464+
if (!this.column || this.column !== prevColumn) {
465+
return;
466+
}
467+
463468
const columnValues = (this.column.dataType === DataType.Date) ?
464469
colVals.map(val => val ? val.toDateString() : val) : colVals;
465470

@@ -496,7 +501,7 @@ export class IgxGridExcelStyleFilteringComponent implements OnDestroy {
496501
if (this.column.dataType === DataType.String && this.column.filteringIgnoreCase) {
497502
const filteredUniqueValues = columnValues.map(s => s?.toString().toLowerCase())
498503
.reduce((map, val, i) => map.get(val) ? map : map.set(val, columnValues[i]),
499-
new Map);
504+
new Map);
500505

501506
this.uniqueValues = Array.from(filteredUniqueValues.values());
502507
} else {

projects/igniteui-angular/src/lib/grids/grid/grid-filtering-ui.spec.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4581,6 +4581,17 @@ describe('IgxGrid - Filtering actions - Excel style filtering #grid', () => {
45814581
loadingIndicator = GridFunctions.getExcelFilteringLoadingIndicator(fix);
45824582
expect(loadingIndicator).toBeNull('esf loading indicator is visible');
45834583
}));
4584+
4585+
it('Should not execute done callback for null column', fakeAsync(() => {
4586+
const compInstance = fix.componentInstance as IgxGridFilteringESFLoadOnDemandComponent;
4587+
GridFunctions.clickExcelFilterIcon(fix, 'ProductName');
4588+
fix.detectChanges();
4589+
4590+
expect(() => {
4591+
GridFunctions.clickExcelFilterIcon(fix, 'Downloads');
4592+
tick(2000);
4593+
}).not.toThrowError(/\'dataType\' of null/);
4594+
}));
45844595
});
45854596

45864597
describe(null, () => {

0 commit comments

Comments
 (0)