SMART datagrid v.1 > Functions
Throw Validation exception.
If specify column object in column parameter, error level icon will be displayed in the corresponding column cell. It can be called from GridBase.onValidateRow, onValidateCell.
grid.onValidateRow = function (grid, row, inserting, values) {
if (values.salary < 1000) {
DataLudi.throwValidationError(DataLudi.ValidationLevel.ERROR, 'Salary is too low.');
}
};
grid.onValidateCell = function (grid, index, inserting, value) {
if (index.column.name() == 'colSalary' && value < 1000) {
DataLudi.throwValidationError(DataLudi.ValidationLevel.ERROR, 'Salary is too low.', index.column);
}
};