I want to validate cells with the variables which are updated with some api calls.
This is ngOnInit(){
this.minVal = 3;
this.maxVal = 8;
this.columns = [
{
data: ‘month’,
type: ‘numeric’,
validator: this.validateMyCell
},
}],
}
This is the validate function
validateMyCell(value, callback) {
if (this.minValue && this.maxValue) {
if (value >= this.maxValue && value <= this.minValue) {
callback(false);
} else {
callback(true);
}
} else {
callback(true);
}
}
minValue and maxValue are variables which are updated from db. In this method, these values are not updated. Is there any way or other such method to resolve this? Any help is appreciated.
I took reference from this link
Thanks