onCellValidating event not fired if value in cell not changed
We have an XML based Editable table with validation logic for certain columns for Numeric fields.
The grid.onCellValidating() is overwritten to check or numeric values, we also set the Template color to red to indicate user that the value is wrong.
The code is working fine, except for one scenario:
1) Modify the cell value from 12.0 to 12A.0, the cell validated is fired and template color is changed to RED
2) Modify the cell value from 12A.0 to 13.0, the cell is validated, the template color is changed to WHITE
3) But, if you modify the cell value from 12A.0 to 12.0 (the previous value in cell), the onCellValidating method is not fired and the cell retains its RED template color, even though the value is accepted.
I was just curious why the onCellValidating is not fired if there is no change in existing value. Any pointers ?
thank you
The grid.onCellValidating() is overwritten to check or numeric values, we also set the Template color to red to indicate user that the value is wrong.
The code is working fine, except for one scenario:
1) Modify the cell value from 12.0 to 12A.0, the cell validated is fired and template color is changed to RED
2) Modify the cell value from 12A.0 to 13.0, the cell is validated, the template color is changed to WHITE
3) But, if you modify the cell value from 12A.0 to 12.0 (the previous value in cell), the onCellValidating method is not fired and the cell retains its RED template color, even though the value is accepted.
I was just curious why the onCellValidating is not fired if there is no change in existing value. Any pointers ?
thank you
grid.onCellValidating = function(text, column, row) {
var template = this.getCellTemplate(column, row);
//allow only numeric values for number formatted cells
if ( checkNumericCol(column) ) {
if ( checkNumber(text) ) {
template.setStyle("color", "red");
return "error";
} else {
template.setStyle("color", "");
}
}
}
Raj Nair
November 2,