Show error on inline edit?
Show error on inline edit?
StevenRaekelboom
Posts: 5Questions: 2Answers: 0
in Editor
Hi,
when using the inline edit I can't get the editor to show the reported error. I think I've followed the proper instructions.
The response from the server after submit looks typically like this:
{"data":[{"id":"1479820183409","Product_code":"aaaa"}],"error":"Cannot change the product code!"}
Shouldn't that work?
This question has accepted answers - jump to:
This discussion has been closed.
Answers
You need to return a field error for inline editing errors.
Allan
Thank you Allan.
In my case, although the example would suggest otherwise, the client code is not aware of where the error is located and in this particular case even, the error is generated by a database trigger so it could be the result of a compound rule impacting multiple fields.
Do I understand it correctly that using 'error' is not working?
FWIW, I solved it ad interim by handling the submitComplete event and showing a dialog to the user when the json contains an error.
Regards,
Steven
Yes, unfortunately the global error is not currently shown when inline editing. That is something I will fix for 1.6 (which will drop in early December).
What you would need to do is listen for
postSubmit
(orsubmitComplete
as you have done) and detect the error. They you couldalert()
it (in the worst case) or usefield().error()
to show it in the field's error message.Allan
Just to confirm - this has been committed now and will be in 1.6.
Allan
A bit late but...thanks!!
Steven