I have a custom validation method configured for my grid column which is now broken in the latest release.
Here is the source for my validation method:
In the latest release, the input.context variable (which I use to obtain the current data row to be validated) is now undefined.
Is this a bug?
Is there a workaround?
Here is the source for my validation method:
validnamevalidation:
function
(input) {
if
(input.is(
'input[data-bind="value:Name"]'
)) {
input.attr(
"data-validnamevalidation-msg"
,
"A team already exists with that name."
);
var
passed =
false
;
var
currentDataItem = $(
"#teamsGrid"
).data(
"kendoGrid"
).dataItem($(input.context));
var
currentId = currentDataItem.Id;
if
(currentId ==
""
) currentId = -1;
$.ajax({
async:
false
,
url: currentViewModel.crudServiceBaseUrl +
"CheckTeamNameBeforeAdd?teamId="
+ currentId +
"&name="
+ input.val().trim(),
success:
function
(result) {
if
(result ==
"False"
) passed =
false
;
else
passed =
true
;
},
error:
function
(jqXHR, textStatus, errorThrown) {
alert(errorThrown +
'. '
+ jqXHR.responseText);
},
complete:
function
(jqXHR, textStatus) {
}
});
return
passed;
}
return
true
;
},
In the latest release, the input.context variable (which I use to obtain the current data row to be validated) is now undefined.
Is this a bug?
Is there a workaround?