Example:
$(document).ready(function () { $("#jqg").jqGrid({ url: '@Url.Action("GetData")', datatype: "json", colNames: ['User name', 'Email'], colModel: [ { name: 'UserName', index: 'UserName', width: 150, sortable: true, editable: true }, { name: 'Email', index: 'Email', width: 150, sortable: true, editable: true, editrules:{email:true, required:false}} ], caption: "User List" });
Validation is here editrules:{email:true, required:false} (therefore, if this field is empty, Ok, but if it contains an invalid email check, it will fail).
Further information and examples in the jqGrid Wiki
And if you want to perform this check without changing your JS code, you can use controls from Trirand that allow you to do this on the -side server
Xeningem
source share