Skip to content

fix(grid): preserve refs and return new array to reflect changes#17320

Open
IvanKitanov17 wants to merge 2 commits into
21.2.xfrom
ikitanov/fix-#17317-21.2.x
Open

fix(grid): preserve refs and return new array to reflect changes#17320
IvanKitanov17 wants to merge 2 commits into
21.2.xfrom
ikitanov/fix-#17317-21.2.x

Conversation

@IvanKitanov17

Copy link
Copy Markdown
Contributor

Closes #17317

Description

Motivation / Context

When using the addRow and deleteRow methods of the grid the data source is not being updated.

Type of Change (check all that apply):

  • Bug fix
  • New functionality
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactoring (no functional changes)
  • Documentation
  • Demos
  • CI/CD
  • Tests
  • Changelog
  • Skills/Agents

Component(s) / Area(s) Affected:

Grids

How Has This Been Tested?

  • Unit tests
  • Manual testing
  • Automated e2e tests

Test Configuration:

  • Angular version:
  • Browser(s):
  • OS:

Screenshots / Recordings

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
  • Accessibility (ARIA, keyboard navigation, focus management) has been verified

Copilot AI review requested due to automatic review settings June 11, 2026 09:40
@IvanKitanov17 IvanKitanov17 added ❌ status: awaiting-test PRs awaiting manual verification grid labels Jun 11, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses #17317 by ensuring IgxGridComponent.addRow() / deleteRow() keep the originally bound data source in sync (instead of breaking the reference by reassigning grid.data) while still triggering the grid pipeline to reflect in-place mutations.

Changes:

  • Updated the grid transaction pipe to always return a new array reference when transactions are disabled.
  • Updated addRowToData / deleteRowFromData to mutate grid.data in place (preserving the original array reference) and clear summary caches instead of cloning/reassigning the data array.
  • (Recommended) Add regression tests to assert the externally bound array is updated across repeated add/delete calls when transactions are disabled.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
projects/igniteui-angular/grids/core/src/common/pipes.ts Returns a shallow-copied array in IgxGridTransactionPipe when transactions are disabled so downstream pipeline/virtualization sees a new reference.
projects/igniteui-angular/grids/core/src/api.service.ts Stops reassigning grid.data on add/delete (preserves bound array ref) and clears summary cache after in-place mutations.

Comment thread projects/igniteui-angular/grids/core/src/common/pipes.ts Outdated
Comment thread projects/igniteui-angular/grids/core/src/api.service.ts
Comment thread projects/igniteui-angular/grids/core/src/api.service.ts
Comment thread projects/igniteui-angular/grids/core/src/api.service.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

grid ❌ status: awaiting-test PRs awaiting manual verification

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants