How to handle an in-line edit failure
How to handle an in-line edit failure
I am not sure how I could display an error dialog on a failed in-line edit with this example:
http://editor.datatables.net/examples/inline-editing/simple.html
What should the json response be on an edit that is returned as a failure by server? Where in the data-table editor initialisation would I specify what to do if there is a failed edit?
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Hi,
The client / server comms documentation details how to send back a field error. There is also an example shown in the second create example.
The downside to inline editing is it can be really disruptive to the layout of the table - particularly when an error needs to be shown. That is why bubble editing is also included in Editor - it doesn't destroy the table's layout!
Regards,
Allan
Allan,
Is there a way to handle general form errors during an inline edit? I have server side-validation that checks to see if the entire row has been locked for editing, in which case the error is not field specific, but applies to the entire row.
I was thinking I'd like to be able to give those errors as a JavaScript alert.
Thanks!
You would need to listen for the
postSubmit
event at the moment. Currently inline editing only handles an error state for the field in question (as that is the only field displayed). As I expand the capabilities of the inline editing feature in future versions I will address that.Allan