I am using jqGrid inline editing with validation in grid using edit rules for adding and updating values to the DB.
The problem is alert for validation fail comes after the values are submitted to the server
colModel: [
{name: 'Country',
index: 'Country',
editable: true,
edittype: 'text',
sortable: false,
align: 'left',
search: false,
validation: { required: true }}
],
There are no
validationproperty for items fromcolModel. You should use correct name of the property editrules:Moreover you can remove unneeded properties
edittype: 'text'andalign: 'left'(see default values in the documentation). Because the value ofindexproperty is the same as the value ofnameyou can remove it too.