Hello,
When editing a column in jqxGrid, i am trying to check if the value exists in the DB (doing a backend call).
columns: [
{ text: 'ValidatedColumn', dataField: 'name', width: 300,
validation: function (cell, value) {
$.ajax({
url: "/getNames?name=" + value ,
type: "GET",
dataType: 'json',
cache: false,
async: false,
success: function(data) {
console.log(data);
if (data.result == "true") {
return true;
} else {
return false;
}
},
error: function(error) {
console.log(error);
return false;
}
});
}
}]
It goes to success and returns data.result == “true”, but the validation fails before that is done. (always returns false)
I’ve went over some answers here on the forum, one of them says to set async to false – which doesn’t help.
Thank you in advance