Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
450
Unable to display error message for duplicate values in iggrid
posted

Hi Team,

I am doing a custom validation for a particular column (BILL_NB) in iggrid .I am able to do the validation but error message (highlighted in yellow) is not displaying in UI . How to display the below error message in UI ,if data is duplicate ?

validatorOptions: {
required: {
errorMessage: "The Bill Number may not be blank."
},
lengthRange: {
max: 20,
errorMessage: "Only 20 characters are allowed"
},

custom: {
method: function (value,options) {
var rows = $("#Pymtgrid").igGrid("rows");
for (var i = 0; i < rows.length; i++) {
var currentRow = rows[i];
var currentValue = $("#Pymtgrid").igGrid("getCellValue", $(currentRow).attr("data-id"), "BILL_NB");

if (value === currentValue && $(currentRow).find(".ui-iggrid-editingcell").length === 0) {

errorMessage: "Duplicate";

return false;
}
}
return true;
}

}

}
}