Show Edit Form After server error

Show Edit Form After server error

solutekasoluteka Posts: 2Questions: 2Answers: 0

Ho, using the Datatable. editor, after a server error we shows the error, but the edit form disappears and the data that the user is trying to insert or update is lost.

How the edition form remains active after an error.

this is the code

                if (d.action === 'edit') {
                    $.each(d.data, function (key, value) {
                        $.ajax({
                            type: 'PUT',
                            url: SERVICE_URL_BASE + '/Api/Controller/' + key,
                            data: JSON.stringify(value),
                            dataType: "json",
                            success: function () {
                                $('#MyDataTable').DataTable().ajax.reload();
                                output.data.push(value);
                                success(value);
                            },
                            error: function (xhr, status, error) {
                                var errorMessage = xhr.status + ': ' + xhr.statusText
                                alert('Error - ' + xhr.responseJSON.Message);
                                success(xhr.responseJSON);
                            }
                        });
                        return;
                    });
                }

Answers

  • allanallan Posts: 63,535Questions: 1Answers: 10,475 Site admin

    return;

    Can you link to the page please? What is xhr.responseJSON when it executes?

    Allan

This discussion has been closed.