I made this function because I want to be able to edit more that one type of column but If I try to edit the mmRabat
and update the value in the totalPris column I get a cirular reference. I need to be able to edit more that one type of column
public totalSum(t: IGridEditEventArgs) {
const column = this.grid.columnList.find(e => e.index === t.cellID.columnID);
const field = column.field
if (field !== 'mmRabat') {
const mmRabat = this.grid.getCellByColumn(t.cellID.rowIndex, 'mmRabat');
const procent = (t.oldValue / Number(t.newValue).valueOf()) * 100;
mmRabat.update(procent);
this.grid.reflow();
}
if (field !== 'totalPris') {
const mmRabat = this.grid.getCellByColumn(t.cellID.rowIndex, 'totalPris');
const procent = (t.oldValue / Number(t.newValue).valueOf()) * 100;
mmRabat.update(procent);
}
}