Skip to content

Conversation

@MayaKirova
Copy link
Contributor

Closes #16358
Closes #16361

Please also re-test: #16146
And also do more extensive testing with more complex merge groups and integration scenarios with other features.

Additional information (check all that apply):

  • Bug fix
  • New functionality
  • Documentation
  • Demos
  • CI/CD

Checklist:

  • All relevant tags have been applied to this PR
  • This PR includes unit tests covering all the new code (test guidelines)
  • This PR includes API docs for newly added methods/properties (api docs guidelines)
  • This PR includes feature/README.MD updates for the feature docs
  • This PR includes general feature table updates in the root README.MD
  • This PR includes CHANGELOG.MD updates for newly added functionality
  • This PR contains breaking changes
  • This PR includes ng update migrations for the breaking changes (migrations guidelines)
  • This PR includes behavioral changes and the feature specification has been updated with them

Copy link
Member

@mddragnev mddragnev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, there is an issue:

  1. Open the performance sample with 1k records.
  2. Add sorting expression
    public sortingExpressions: ISortingExpression[] = [
        { fieldName: 'Name', dir: SortingDirection.Asc },
    ];
  1. Set cellMergeMode="always". Set [merge]=true on all columns
  2. You get the following:
Screenshot 2025-10-27 at 3 53 57 pm 5. Click on the row with ID 534. You will get the following: Screenshot 2025-10-27 at 3 55 09 pm The two rows above the unmerged row are broken

@MayaKirova MayaKirova requested a review from mddragnev October 28, 2025 10:35
@mddragnev
Copy link
Member

If you run the performance sample with 1k records with [cellMergeMode]="'always'" on the grid and [merge]="true" on the columns, then you get the following:
Screenshot 2025-10-29 at 4 19 54 pm
If you now click on row with ID = 8 and observe the row with ID 10 and 11 you can see that the group layout there is broken:
Screenshot 2025-10-29 at 4 21 11 pm

};
// deep clone of inner map
for (const [key, value] of origRecord.cellMergeMeta) {
objCopy.cellMergeMeta.set(key, structuredClone(value));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand why you clone the merged record, but why is the deep cloning at all? Isnt just changing the reference of the object enough? I dont think that using structuredClone for a grid with 1M records where a value object might be very nested is a good idea. Having said that, if you open the performance sample with 1M records, sort by name and unmerge the first row, the grid hangs and throws an error.
What if we just copy the object and the override the specific column. Something like:

if (unmergedRec.cellMergeMeta?.get(col.field)) {
                        // deep clone of object, since we don't want to pollute the original fully merged collection.
                        const objCopy = {
                            recordRef: origRecord.recordRef,
                            ghostRecord: origRecord.ghostRecord,
                            cellMergeMeta: new Map<string, IMergeByResult>(origRecord.cellMergeMeta.entries())
                        };
                  
                       // update copy with new meta from unmerged data record, but just for this column
                        objCopy.cellMergeMeta?.set(col.field, unmergedRec.cellMergeMeta.get(col.field));
                        result[index + i] = objCopy;
                    } else {
                        // this is the unmerged record, with no merge metadata
                        result[index + i] = unmergedRec;
                    }

@MayaKirova MayaKirova requested a review from mddragnev October 30, 2025 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

4 participants