Skip to content

Commit 3533b03

Browse files
committed
fix(grid): group records correctly when ignoreCase is true
1 parent 241667f commit 3533b03

File tree

1 file changed

+7
-2
lines changed
  • projects/igniteui-angular/src/lib/grids/common

1 file changed

+7
-2
lines changed

projects/igniteui-angular/src/lib/grids/common/strategy.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,12 +109,17 @@ export class IgxSorting implements IGridSortingStrategy {
109109
const res = [];
110110
const key = expression.fieldName;
111111
const len = data.length;
112-
const groupval = this.getFieldValue(data[index], key, isDate);
112+
let groupval = this.getFieldValue(data[index], key, isDate);
113113
res.push(data[index]);
114114
index++;
115115
const comparer = expression.groupingComparer || DefaultSortingStrategy.instance().compareValues;
116116
for (let i = index; i < len; i++) {
117-
if (comparer(this.getFieldValue(data[i], key, isDate), groupval) === 0) {
117+
let fieldValue = this.getFieldValue(data[i], key, isDate);
118+
if (expression.ignoreCase) {
119+
fieldValue = fieldValue.toLowerCase();
120+
groupval = groupval.toLowerCase();
121+
}
122+
if (comparer(fieldValue, groupval) === 0) {
118123
res.push(data[i]);
119124
} else {
120125
break;

0 commit comments

Comments
 (0)