Skip to content

igx-grid - addRow()/deleteRow() not working as documented #17317

@adzabazz

Description

@adzabazz

Description

Documentation for the methods igxgrid.addRow() and deleteRow() says that these should update the grid and the data source behind it. However, this is not true as demonstrated here:

https://stackblitz.com/edit/iezuqmpq-neon7tbj?file=src%2Fapp%2Fgrid%2Fgrid%2Fgrid.component.ts,package.json.

If you click the Add or Delete buttons in the sample multiple times, it is clear that the data source is not being updated. There is also no workaround using these methods that exists to make them functionally useful any more.

Spreading the array behind the grid and updating it now updates the grid itself which is useful but this requires a major refactor if these methods are used frequently through the application. If these are to be present in the ignite-ui documentation, they should at least be useable as suggested.

Framework

Angular

Angular Version

21.2.1

Ignite UI for Angular Version

21.2.1

Component / Area

Grid

Browser

Edge

Operating System

Windows

Command Not Working

Steps to Reproduce

  1. Open StackBlitz sample
  2. Click Add (3 times)
  3. Observe the logs not adding to the dataSource after the initial Add and the grid now only adding duplicate rows after 5
  4. Click Delete (3 times)
  5. Observe the logs not removing from the dataSource and also the grid only removing the last row once

Actual Result

Grid does not correctly add or delete the rows as in the repro steps.

Expected Result

Datasource is kept aligned with actions occurring on the grid using these methods as documentation suggests.

Reproduction URL

https://stackblitz.com/edit/iezuqmpq-neon7tbj?file=src%2Fapp%2Fgrid%2Fgrid%2Fgrid.component.ts,package.json.

Attachments

Documented expectation:
Image

Image

Metadata

Metadata

Assignees

Labels

🐛 bugAny issue that describes a bug✅ status: resolvedApplies to issues that have pending PRs resolving them, or PRs that have already merged.

Type

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions