Is there a recommendation for adding more controls to the Editor's Delete dialog box?
Is there a recommendation for adding more controls to the Editor's Delete dialog box?
Hi Allan,
In my specific scenario, the end-user clicks the Delete button in the "Are you sure?" dialog that comes standard with the Editor. The server-side logic validates and returns an error in the fieldErrors array. See the code snippet below:
success: function (result) {
if (result.editorAction === "remove") {
if (result.fieldErrors) {
result.fieldErrors = null;
alert("This record cannot be deleted because at least 1 active employee uses the Ax Financial Dimension value.");
}
}
// hook back into datatables editor here
successCallback(result);
},
This is fine, except I would prefer to:
(1) Put the error message on the dialog box itself instead of using a JavaScript alert
(2) Show a special check-box control that would allow the end-user to "force" the delete anyway
(3) Have a "cancel" button on the dialog as another way to exit the delete dialog
Thoughts?
Thanks,
Mike
Answers
Hi Mike,
Use
error()
This is the more tricky one. You would need to use
message()
to insert the checkbox and thenajax.data
to add the checkbox information to the Ajax request so the server can see it and allow the delete to happen.Use
buttons()
or thebuttons
option in theform-options
that is used for the delete.Regards,
Allan