316/5000
When I add a record, valid the order by ajax, to see if it already exists, the problem is that when editing, it also does the validation, and remains blocked in that field, because it already exists!
Can I turn off in edit mode?
$ col [“editoptions”] = array (“onblur” => “validate_onblur (this)”);
https://imgur.com/a/VKhB6yk
Greetings, Sergio Pulido.
I’ll be updating back after working.
Hello,
Your ticket somehow got unanswered.
Solution for your case is to identify if the dialog is add or edit. If it is edit you can skip the ajax call.
To check the operation, you can verify the value of first column (PK or ID) using jquery selector. It will be empty for add and will have data for edit dialog.
E.g.
Add: https://i.imgur.com/L6VTFuR.png
Edit: https://i.imgur.com/XCSE8r3.png
Selector: https://i.imgur.com/S4Vwku1.png
if ( $(“[name=product_id].FormElement”).val() == “”)
{
// do ajax validation otherwise not.
}