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

Lack example for validation in editable fields #41

Open
bfallar3 opened this issue Oct 10, 2017 · 5 comments
Open

Lack example for validation in editable fields #41

bfallar3 opened this issue Oct 10, 2017 · 5 comments

Comments

@bfallar3
Copy link

Can you provide a sample on how to display and response an error to the dataTable when it fails validation?

@galbini
Copy link

galbini commented Oct 11, 2017

You need to return an object where fields is the same as column.property value.

Example with the folowing two columns
column : {
property:"name"
}

column:{
property:"trace.creationDate"
}

the return of server must be of this form

{
"name":["bad format : only [A-Za-z]"],
"trace.creationDate":["required"]
}

I hope that help you.

@bfallar3
Copy link
Author

bfallar3 commented Oct 11, 2017 via email

@bfallar3
Copy link
Author

bfallar3 commented Oct 11, 2017 via email

@galbini
Copy link

galbini commented Oct 11, 2017

I don't see your code snippet. no images attach.

The save must be execute by UDT. UDT used the save.url configuration to call your server.

Then your server api need to return a HttpResponse with code different than 200 with a JSON object in the body response. The json object must be match the rules describe in the first comment.

Guillaume

@bfallar3
Copy link
Author

bfallar3 commented Oct 11, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants