SMART datagrid v.1 > Classes > EditValidation
Callback function which determines validation error.
If explicitly return Boolean false, it will consider it as a validation failure.
You can also validate by specifying expression in expression property instead of callback. Instead, if specify this callback, expression property will be ignored. The values which will be transferred to scope variable have been described in the table below.
Defaults to null.
Property | Explanation |
---|---|
'index' | The Location of data cell. |
'row' | The object of Grid Row. |
'value' | The value of data cell. |
column.setValidations([{
"callback": function (scope) {
if (scope.value < 1000) {
return false;
}
},
"level": DataLudi.ValidationLevel.ERROR,
"message": "The volume should be greater than 1000."
}]);