Skip to content

Commit 3b3b3f8

Browse files
MKirovaMKirova
authored andcommitted
fix(igxGrid): Fix merge when merge groups partially overlap.
1 parent b126b07 commit 3b3b3f8

File tree

1 file changed

+4
-14
lines changed

1 file changed

+4
-14
lines changed

projects/igniteui-angular/src/lib/grids/grid/grid.pipes.ts

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -131,27 +131,17 @@ export class IgxGridUnmergeActivePipe implements PipeTransform {
131131
}
132132
let result = cloneArray(collection) as any;
133133
uniqueRoots.forEach(x => {
134-
const index = result.indexOf(x);
134+
const index = collection.indexOf(x);
135135
const colKeys = [...x.cellMergeMeta.keys()];
136136
const cols = colsToMerge.filter(col => colKeys.indexOf(col.field) !== -1);
137-
let res = [];
137+
let data = [];
138138
for (const col of cols) {
139139

140140
let childData = x.cellMergeMeta.get(col.field).childRecords;
141141
const childRecs = childData.map(rec => rec.recordRef);
142-
const isDate = col?.dataType === 'date' || col?.dataType === 'dateTime';
143-
const isTime = col?.dataType === 'time' || col?.dataType === 'dateTime';
144-
res = this.grid.mergeStrategy.merge(
145-
[x.recordRef, ...childRecs],
146-
col.field,
147-
col.mergingComparer,
148-
res,
149-
activeRowIndexes.map(ri => ri - index),
150-
isDate,
151-
isTime,
152-
this.grid);
153-
142+
data = data.concat([x.recordRef, ...childRecs]);
154143
}
144+
const res = DataUtil.merge(Array.from(new Set(data)), cols, this.grid.mergeStrategy, activeRowIndexes.map(ri => ri - index), this.grid);
155145
result = result.slice(0, index).concat(res, result.slice(index + res.length));
156146
});
157147

0 commit comments

Comments
 (0)