Skip to content

Commit 4a1b124

Browse files
committed
fix(grid): use different approach
1 parent 9bc6dd3 commit 4a1b124

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
* ```
@@ -268,13 +268,13 @@ export class IgxGridExcelStyleFilteringComponent extends BaseFilteringComponent
268268

269269
/**
270270
* Gets the maximum height.
271-
*
272-
* Setting value in template:
271+
*
272+
* Setting value in template:
273273
* ```ts
274-
* [maxHeight]="'<number><unit (px|rem|etc..)>'"
274+
* [maxHeight]="'<number><unit (px|rem|etc..)>'"
275275
* ```
276-
*
277-
* Example for setting a value:
276+
*
277+
* Example for setting a value:
278278
* ```ts
279279
* [maxHeight]="'700px'"
280280
* ```
@@ -555,6 +555,11 @@ export class IgxGridExcelStyleFilteringComponent extends BaseFilteringComponent
555555
private renderValues() {
556556
this.filterValues = this.generateFilterValues();
557557
this.generateListData();
558+
this.expressionsList.forEach(expr => {
559+
if (expr.expression.condition.name === 'in' && this.column.dataType === GridColumnDataType.String) {
560+
this.modifyExpression(expr);
561+
}
562+
});
558563
}
559564

560565
private generateFilterValues() {
@@ -585,6 +590,16 @@ export class IgxGridExcelStyleFilteringComponent extends BaseFilteringComponent
585590
return filterValues;
586591
}
587592

593+
private modifyExpression(expr: ExpressionUI) {
594+
const lowerCaseFilterValues = new Set(Array.from(expr.expression.searchVal).map((value: string) => value.toLowerCase()));
595+
596+
this.grid.data.forEach(item => {
597+
if (lowerCaseFilterValues.has(item[this.column.field]?.toLowerCase())) {
598+
expr.expression.searchVal.add(item[this.column.field]);
599+
}
600+
});
601+
}
602+
588603
private generateListData() {
589604
this.listData = new Array<FilterListItem>();
590605
const shouldUpdateSelection = this.areExpressionsSelectable();

0 commit comments

Comments
 (0)