primereact icon indicating copy to clipboard operation
primereact copied to clipboard

DataTable: Edit Programmatic all row cannot read properties of undefined (reading 'data')

Open huudatk53 opened this issue 3 years ago • 2 comments

Describe the bug

I custom edit Programmatic all row in table whit one click button. It only working with last row when I edit other row it show error image image

example: https://codesandbox.io/s/solitary-bush-hwl9d7?file=/src/demo/DataTableEditDemo.js

Reproducer

https://codesandbox.io/s/solitary-bush-hwl9d7?file=/src/demo/DataTableEditDemo.js

PrimeReact version

8.1.1

React version

17.x

Language

TypeScript

Build / Runtime

Vite

Browser(s)

No response

Steps to reproduce the behavior

click Activate 1st => edit last row (it's ok) => edit other row it's not working

Expected behavior

No response

huudatk53 avatar Jun 30 '22 08:06 huudatk53

Your use case doesn't make sense to me. It looks like when you press "Activate 1st" you want it to only activate 1 row for editing but its enabling them all?

melloware avatar Jul 04 '22 13:07 melloware

Actually, 'Activate 1st' = Edit, I use the button Edit (in form), after I change rows. Finally, I will submit that form Sorry I did'nt change text because I just changed lable button, Codepen not working. image

huudatk53 avatar Jul 04 '22 15:07 huudatk53

OK I think I have fixed it. 😄 The error at least anyway.

melloware avatar Dec 14 '22 13:12 melloware