Describe the bug
When using the grid filters to filter out records first, and then adding a record, the grid's internal references are not updated correctly and this will lead to data corruption. An example is the row click event, which will provide the data for another record than is actually shown on screen.
To Reproduce
I have changed the datagrid-add-row.demo.ts and datagrid-add-row.demo.html files from the enterprise-ng project. The problem itself is not related to angular, however. The updated files are attached to this issue.
To reproduce:
first filter on the name by typing 'o' in the filter box.
Then fill in 'order' in the edit box at the top
and press Add row.
If you click on the last record shown ('Prop') , the 'Selected Record' field at the bottom will shown 'Abc' instead.
When you remove the filter, the problem will disappear.
The problem is caused by a wrong index on the
tag.
Version
v4.97.0
Screenshots
I have attached a video that demoes the steps taken to reproduce the problem.
Describe the bug When using the grid filters to filter out records first, and then adding a record, the grid's internal references are not updated correctly and this will lead to data corruption. An example is the row click event, which will provide the data for another record than is actually shown on screen.
To Reproduce I have changed the datagrid-add-row.demo.ts and datagrid-add-row.demo.html files from the enterprise-ng project. The problem itself is not related to angular, however. The updated files are attached to this issue. To reproduce:
The problem is caused by a wrong index on the
Version v4.97.0
Screenshots I have attached a video that demoes the steps taken to reproduce the problem.
datagrid.zip
https://github.com/user-attachments/assets/24b54922-8da6-4597-97b1-2da9ea261c39
@DavidMoerman Can you explain what you mean about the problem is on an index on a tag? Are you seeing a fix you can PR for this?
I noticed that the [tr] tags contain references to the dataset, and that those references get mixed up. But I do not know where and why this happens.
ok thanks @DavidMoerman ~ what do you mean by the "index on a tag"?
it's the data-index on the tr tag that gets corrupted; in this example, in the actual dataset this is the fourth element (position 3 counted from 0):