Hi Alex,
Grid control validates the user input synchronously. However you can handle the validate the user inputs at server side using actionBegin event. Please follow the below steps to achieve your requirement.
1. Register actionBegin event and check if the requestType as save.
2. Cancel the actionBegin event using args.cancel and set a flag named doValidation which permit validation when true .
3. Perform the server validation and in the success event call the endEdit method of the grid and disable the flag to skip validation.
The code example which done using the above steps will look like below.
var grid = new Grid({
...
actionBegin: (e) => {
if (e.requestType === 'save') {
if (doValidation) { // Flag to allow validation, initial value is true
args.cancel = true;
// Perform the server validation
// in the succes of server validation
serverValidation(e.data).then(result => {
doValidation = false;
grid.endEdit();
});
} else {
doValidation = true;
}
}
}
});
|
Regards,
Madhu Sudhanan P