Hi,
I'm trying to access other cell values in a custom validator. I have been following this knowledge base doc: https://www.syncfusion.com/kb/7129/how-to-access-row-data-in-custom-validator.
I have not had any luck getting it to work. "serializeAllArray()" only returns the data for the current cell. I need to compare it to other cells in the same row.
Is it because my grid is in "Batch" edit mode? Am I missing something or done something wrong? Below is my javascript:
$(function () {
$.fn.serializeAllArray = function () {
var data = $(this).serializeArray();//returns the form data
$(':disabled[name]', this).each(function () { // when I step through the javascript it never goes in here
data.push({ name: this.name, value: $(this).val() });//push the disabled elements values also to the JSON array
});
return data;
}
$.validator.addMethod("intBetween", function (value, element, params) {
var data = $(element.closest("form")[0].form).serializeAllArray();//holds the form data in name and value pair
// data only contains name and value pair for current cell. I need to get the entire row
// todo: validation
return true;
}, intBtErrMsg);
});
Thanks,
Chris