I have this grid options :
gridOptions: GridOptions = {
suppressFieldDotNotation: true,
paginationAutoPageSize: false,
paginationPageSize: 10,
domLayout: 'autoHeight',
rowMultiSelectWithClick: false,
rowSelection: 'multiple',
onFilterChanged: (event) => this.onFilterChanged(event),
onCellValueChanged: (event) => this.onCellValueChanged(event)
} as GridOptions;
On cell value i have this:
onCellValueChanged(event) {
if (typeof event.newValue === 'string') {
this.toastrService.error(event.newValue + ' is not a number!');
return;
}
}
Only one column is editable, and what i want is user enter some value that is not number or decimal, for example (1, 1.1, 1,1), that i set that column to zero, and display message.
I tried like this but it display validation message for decimal values 1.1 and 1,2 ( with dot and comma), and other problem is that i dont know how to set that column on that row to zero if validation is false.
Any suggestion?