SMART datagrid v.1 > Classes > GridBase

Back  Forward

DataLudi.GridBase.onValidateCell  event

It will be fired when commit cell editing or row editing. 

If throw an exception within this event handler, editing committing will be discontinued, and an error message will be displayed according to the settings. You can throw an exception by calling throwValidationError global function. 

Instead of using this event, you can specify validation of each column by DataColumn.validations property. You can use onValidateRow event in the validation on a row basis. 

function onValidateCell (grid: GridBase, index: CellIndex, inserting: Boolean, value: *);
Returns
Void
Parameters
grid - GridBase.
index - CellIndex.
inserting - Boolean.
value - *.
Code -1
    grid.onValidateCell = function (grid, index, column) {
        DataLudi.throwValidationError(DataLudi.ValidationLevel.ERROR, 'message', column);
    });
See Also
onValidateRow
throwValidationError
DataColumn.validations
EditValidation
Examples
Cell Editing
Edit Events
Edit Keys
Row Updating
Row Inserting
Row Deleting