I'm having some issues with Ag-grid and can't really understand the issue. I'm using cellValueChanged event to pass a Validation function to the cell.
The issue is that on the first time a user edits the cell it runs the validation function but does not mark the cell as "with error" ( red border and tooltip ). All edits after the first edit run fine, showing the red border and tooltip if the cell has an error.
CustomGrid.GridObject[CustomGrid.TemporaryVariables.arrPos].gridOptions.api.addEventListener('cellValueChanged', function(e) {
CustomGrid.ValidationFeature.validation(e);
});
CustomGrid.ValidationCtrl.validation = function (params) {
if(CustomGrid.DirtyCellCtrl.isCellDirty(params) && params.colDef.Validation) {
params.colDef.Validation.call({}, params);
}
};
Note: CustomGrid.DirtyCellCtrl.isCellDirty is a custom helper function to check if cell has a different valid value and returns true/false. For this case admit it always returns true.
Any help or hints will be appreciated. Thanks in advance.