Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
huudatk53 opened this issue Jun 30, 2022 · 3 comments · Fixed by #3785
Closed
Assignees
Labels
Type: Bug Issue contains a defect related to a specific component.
Milestone

Comments

@huudatk53
Copy link

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 huudatk53 added Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible Type: Bug Issue contains a defect related to a specific component. labels Jun 30, 2022
@huudatk53 huudatk53 changed the title Component: DataTable Edit Programmatic DataTable: Edit Programmatic Jun 30, 2022
@huudatk53 huudatk53 changed the title DataTable: Edit Programmatic DataTable: Edit Programmatic all row cannot read properties of undefined (reading 'data') Jun 30, 2022
@melloware
Copy link
Member

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?

@huudatk53
Copy link
Author

huudatk53 commented Jul 4, 2022

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

@mertsincan mertsincan removed the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Aug 25, 2022
@melloware melloware self-assigned this Dec 14, 2022
@melloware melloware added this to the 8.7.4 milestone Dec 14, 2022
@melloware
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a defect related to a specific component.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants