This example uses a Cell Editor to validate each time the value is changed, if the user leaves the edit before this is complete, or while it is invalid, it will not allow the edit. You can use this example to implement validation calls to a backend, or using an async front-end validation library.
The key to achieving this behaviour is the following function:
ValidationCellEditor.prototype.validate = async function(value) {
// Simulate awaiting the result of an api call to validate
// Replace this with your validation logic
return await new Promise(resolve =>{
setTimeout(() => {
resolve(value.length === 6);
},2000);
});
}
For more details on implementing this behaviour, please see the following example:
https://plnkr.co/edit/gSHnQIWpBhCCEPPT
Comments
0 comments
Please sign in to leave a comment.