I'm submitting a ... (check one with "x")
[x] bug report => Search github for a similar issue or PR before submitting
[ ] feature request => Please check if request is not on the roadmap already https://github.com/primefaces/primeng/wiki/Roadmap
[ ] support request => Please do not submit support request here, instead see http://forum.primefaces.org/viewforum.php?f=35
Plunkr Case (Bug Reports)
Please fork the plunkr below and create a case demonstrating your bug report. Issues without a plunkr have much less possibility to be reviewed.
http://plnkr.co/edit/4oBtDrIFRx1ORfcOp8BJ?p=preview
Current behavior
Datatable row index is not updating properly when a row is removed.
Expected behavior
Update the rowIndex when model has been changed.
Minimal reproduction of the problem with instructions
Just click "Delete Row" button in in middle of given plunker
What is the motivation / use case for changing the behavior?
Please tell us about your environment:
Angular version: 4.0.0
PrimeNG version: 4.0.0.rc.1
Browser: [all ]
Language: [all | TypeScript 2.2 | ES6/7 | ES5]
Node (for AoT issues): node --version =
@angular/cli: 1.0.0
node: 6.9.5
os: win32 x64
Hi, the solution that worked for me was to encode the data then decode it so it will hold no reference to the changed array.
JSON.decode(JSON.encode(array)) should work.
Hi, thanks for your interest.
Am using typescript class and methods to compute few runtime values.
if i encode and decode into json object then the class may not have methods and results an error
Any updates for this issue ?
This also creates a problem with a grouped DataTable.
Same problem here: I have to insert/delete/reorder rows.
Also note that, when you delete row # 4 in the linked plnkr for instance, and afterwards row # 5, then # 6 is removed because it is the 5th element in the backing array. This is a showstopper for me.
My versions are:
@angular/cli: 1.0.0
node: 7.8.0
os: win32 x64
@angular/*: 4.0.1
I've replicated but cannot find a solution right now.
Hi @cagataycivici,
AFASK am updating here,
i have forked the same plunkr http://plnkr.co/edit/86PPOwshePXzIsxGDtmH?p=preview with html table.
here the index property is changed when a row gets deleted.
i think the problem is primeng index property is not gets bind properly.
i may not given a exact solution but i hope this is something relevant.
Any updates @cagataycivici?
Same issue here. The rowIndex is not being updated when deleting a row.
Same issue here.
Most helpful comment
Same issue here. The rowIndex is not being updated when deleting a row.