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

[data grid] inline edit validation #12162

Closed
Mimmo47 opened this issue Feb 21, 2024 · 2 comments
Closed

[data grid] inline edit validation #12162

Mimmo47 opened this issue Feb 21, 2024 · 2 comments
Labels
component: data grid This is the name of the generic UI component, not the React module! feature: Editing Related to the data grid Editing feature support: commercial Support request from paid users

Comments

@Mimmo47
Copy link

Mimmo47 commented Feb 21, 2024

The problem in depth

In a grid I have to edit some cells in a row, but the value must be validated for minimum/maximum length, data type, matching against a look-up table or an array, etc.
Is it possible?
Example: one of the columns contains a phone number and the new value must not accept alpha chars
Another columg contains Currency codes (USD, EUR, GBP, etc.) that should be checked aganst an array of allowed currencies.
And so on.
What shall I do to implement a valdation of this type?
Thanks

Your environment

`npx @mui/envinfo`
  Don't forget to mention which browser you used.
  Output from `npx @mui/envinfo` goes here.

Search keywords: Edit Validation
Order ID: Order 83077

@Mimmo47 Mimmo47 added status: waiting for maintainer These issues haven't been looked at yet by a maintainer support: commercial Support request from paid users labels Feb 21, 2024
@michelengelen
Copy link
Member

Hey @Mimmo47 ... yes, it is possible. You can use the preProcessEditCellProps method from the column definition for this.

we do have a page on the docs with some examples here: Validation docs

Copy link

⚠️ This issue has been closed.
If you have a similar problem, please open a new issue and provide details about your specific problem.
If you can provide additional information related to this topic that could help future readers, please feel free to leave a comment.

How did we do @Mimmo47?
Your experience with our support team matters to us. If you have a moment, please share your thoughts through our brief survey.

@michelengelen michelengelen added component: data grid This is the name of the generic UI component, not the React module! feature: Editing Related to the data grid Editing feature and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Feb 22, 2024
@michelengelen michelengelen changed the title GRID inline edit validation [data grid] inline edit validation Feb 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: data grid This is the name of the generic UI component, not the React module! feature: Editing Related to the data grid Editing feature support: commercial Support request from paid users
Projects
None yet
Development

No branches or pull requests

2 participants