In a riff on the discussion you had here:
https://datatables.net/forums/discussion/32665/formoptions-oncomplete-none-clears-s-action
Would it be possible to have an additional "onComplete" member of the formOptions family?
> formOptions: {
> main: {
> onComplete: 'wait' // my idea, not a real option
> }
This option would keep the editor in an open, un-submitted or actionable state (whatever you call it), so that events like "submitSuccess" can be fired over again. The API we're dealing with returns zero or one as a success parameter, so we're trying onComplete: 'none' as a formOption along with
> editor1.on( 'submitSuccess', function ( e, json, data, action ) {
> if(json.success==1){
> toastr.info("Changes submitted.","Success!");
> editor1.close();
> }
> }
> else{
> apiNonSuccessHandler(json); // global toastr/logging thing
> // and the editor stays open
> }
> }
This solution leaves the Editor open if the API returns a fail, but in a state where it cannot be submitted again.
We'll look at the solution presented in the discussion below, but this would mean a considerable rewrite. I was guessing - in my typically novice way - that an option like this in a future release might help more people.
https://datatables.net/forums/discussion/26838/how-do-i-prevent-editor-from-committing-changes-on-ajax-call-during-presubmit
Thanks for reading.