SMART datagrid v.1 > Classes > EditValidation

Back  Forward

DataLudi.EditValidation.expression  property

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.

Getter
function expression(): String
Setter
function setExpression(value: String)
Table-1  Cell Validation variables
VariableExplanation
'value'The value of data cell.
'row'index of grid row.
'datarow'dataIndex of grid row.
'checked'checked state of grid row.
Code -1
    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
    }]);
See Also
callback
level
message
active
Validation Overview
Cell Editing Overview
Examples
Cell Editing
Cell Validation
Row Validation