Posted 3 July 2020, 2:34 am EST
Ashwin ! I tried with that but the problem is s.activeEditor.value is always giving the old value .But in sample you gave it is getting new value.
So I tried with init method
s.itemFormatter = (panel, r, c, cell) => {
if (r > 0 && panel.rows[r].dataItem) {
const item = panel.rows[r].dataItem;
}
s.formatItem.addHandler((s, e) => {
const col = s.columns[e.col];
if (e.panel.cellType !== wjcGrid.CellType.Cell) {
return;
}
if (s.columns[e.col].binding === ‘startDate’) {
let dt = s.getCellData(e.row, e.col);
if (dt) {
dt = new Date(dt);
//const date = wjcCore.Globalize.parseDate(dt.toISOString(), col.format); // the date entered should be in correct format
// e.cancel = (date && date.getFullYear() <= 1900); // cancel the event is less than 1900
if(!(dt.getFullYear() >= 1900)){
this.cancelDatechange = true;
}
e.cancel = !(dt.getFullYear() >= 1900);
}
But problem is e.cancel is true here but invalid date is still there and it didn’t stop.
Any pointers ?