SMART datagrid v.1 > Classes > EditValidation
The expression which determines validation error.
Please refer to Expression Overview topic about expression grammar, etc. If specify callback function, the expression which has been specified in this property will be ignored.
The variable list which can be used in expression has been described in the table below.
Defaults to null.
Variable | Explanation |
---|---|
'value' | The value of data cell. |
'row' | index of grid row. |
'datarow' | dataIndex of grid row. |
'checked' | checked state of grid row. |
column.setValidations([{
"expression": "value >= 2000",
"level": DataLudi.ValidationLevel.INFO,
"message": "The year should be greater than 2000.",
"mode": DataLudi.ValidationMode.INSERT
}, {
"expression": "value < 22000",
"level": DataLudi.ValidationLevel.INFO,
"message": "The year should be less than 2020.",
"mode": DataLudi.ValidationMode.UPDATE
}]);