Skip to content

Commit 3e6891c

Browse files
committed
fix(grid): use different approach
1 parent a647cad commit 3e6891c

File tree

1 file changed

+25
-10
lines changed

1 file changed

+25
-10
lines changed

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

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -221,13 +221,13 @@ export class IgxGridExcelStyleFilteringComponent extends BaseFilteringComponent
221221

222222
/**
223223
* Gets the minimum height.
224-
*
225-
* Setting value in template:
224+
*
225+
* Setting value in template:
226226
* ```ts
227-
* [minHeight]="'<number><unit (px|rem|etc..)>'"
227+
* [minHeight]="'<number><unit (px|rem|etc..)>'"
228228
* ```
229-
*
230-
* Example for setting a value:
229+
*
230+
* Example for setting a value:
231231
* ```ts
232232
* [minHeight]="'700px'"
233233
* ```
@@ -258,13 +258,13 @@ export class IgxGridExcelStyleFilteringComponent extends BaseFilteringComponent
258258

259259
/**
260260
* Gets the maximum height.
261-
*
262-
* Setting value in template:
261+
*
262+
* Setting value in template:
263263
* ```ts
264-
* [maxHeight]="'<number><unit (px|rem|etc..)>'"
264+
* [maxHeight]="'<number><unit (px|rem|etc..)>'"
265265
* ```
266-
*
267-
* Example for setting a value:
266+
*
267+
* Example for setting a value:
268268
* ```ts
269269
* [maxHeight]="'700px'"
270270
* ```
@@ -509,6 +509,11 @@ export class IgxGridExcelStyleFilteringComponent extends BaseFilteringComponent
509509
private renderValues() {
510510
this.filterValues = this.generateFilterValues();
511511
this.generateListData();
512+
this.expressionsList.forEach(expr => {
513+
if (expr.expression.condition.name === 'in' && this.column.dataType === GridColumnDataType.String) {
514+
this.modifyExpression(expr);
515+
}
516+
});
512517
}
513518

514519
private generateFilterValues() {
@@ -539,6 +544,16 @@ export class IgxGridExcelStyleFilteringComponent extends BaseFilteringComponent
539544
return filterValues;
540545
}
541546

547+
private modifyExpression(expr: ExpressionUI) {
548+
const lowerCaseFilterValues = new Set(Array.from(expr.expression.searchVal).map((value: string) => value.toLowerCase()));
549+
550+
this.grid.data.forEach(item => {
551+
if (lowerCaseFilterValues.has(item[this.column.field]?.toLowerCase())) {
552+
expr.expression.searchVal.add(item[this.column.field]);
553+
}
554+
});
555+
}
556+
542557
private generateListData() {
543558
this.listData = new Array<FilterListItem>();
544559
const shouldUpdateSelection = this.areExpressionsSelectable();

0 commit comments

Comments
 (0)