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

Support updating rows in the data provider #3001

Merged
merged 14 commits into from
Dec 20, 2023

Conversation

Janpot
Copy link
Member

@Janpot Janpot commented Dec 15, 2023

Closes #2887

Adds support for an updateRecords property in the data provider. When this property exists, theconnected data grid will have a row edit button. After clicking save, the backend updateRecords method will be called with the updated values.

Loading state is reflected in the save icon. error state is reflected in the same way as we do for row deletion: #2978

Screen.Recording.2023-12-15.at.17.41.41.mov

docs: https://deploy-preview-3001--mui-toolpad-docs.netlify.app/toolpad/concepts/data-providers/#row-editing

To Do:

  • Add test

@Janpot Janpot added the new feature New feature or request label Dec 15, 2023
@Janpot Janpot marked this pull request as ready for review December 20, 2023 13:31
@Janpot Janpot requested a review from a team December 20, 2023 13:31
Copy link
Member

@bharatkashyap bharatkashyap left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A hugely critical improvement! 🥳

Is the case when the ID field isn't id sufficient enough to handle before this lands? To me, it's okay for this to go and us to error gracefully

@Janpot
Copy link
Member Author

Janpot commented Dec 20, 2023

Is the case when the ID field isn't id sufficient enough to handle before this lands? To me, it's okay for this to go and us to error gracefully

I'm correcting a bug in this PR where if the first row has id: 0 it would mistakenly flag it as having no explicit id. This bug must be fixed for the tests to run correctly.

@Janpot Janpot merged commit f00ba36 into mui:master Dec 20, 2023
11 checks passed
@Janpot Janpot deleted the update-data-provider branch December 20, 2023 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support server-side row editing
2 participants