SMART datagrid v.1 > Classes > DataColumn

Back  Forward

DataLudi.DataColumn.validations  property

The array of EditValidation objects which validate if the editing contents are appropriate when committing editing of data cell involved in this column. 

When specifying as Setter, you can specify either EditValidation or setting object rather than array. 

Defaults to null.

Getter
function validations(): EditValidationCollection
Setter
function setValidations(value: [EditValidation|Object])
Note
Code -1
    grid.columnByName('colPrice').setValidations([{
        expression: 'value > 1000',
        level: DataLudi.ValidationLevel.ERROR,
        message: 'The unit price should be greater than 1000.'
    }, {
        callback: function (scope) {
            if (scope.value > 2000) {
                return false;
            }
        },
        level: DataLudi.ValidationLevel.INFO,
        message: 'The unit price should be less than 2000.'
    }]);
Code -2
    // You can specify only one.
    grid.columnByName('colQuantity').setValidations({
        expression: 'value > 100',
        level: DataLudi.ValidationLevel.ERROR,
        message: 'The quantity should be greater than 100.'
    });
See Also
editable
Validation Overview
Cell Editing Overview
EditValidation
validations
editOptions
Examples
Cell Editing
Cell Validation
Row Validation