Skip to content

Replies

0
Thomas Kleist
Thomas Kleist answered on Sep 9, 2019 7:09 PM

okay  lets say I have 4 columns A B D and D  in the first case I edit Columns D and update B and D next case I edit Column B and update D

0
Thomas Kleist
Thomas Kleist answered on Sep 6, 2019 4:23 AM

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);
}
}
0
Thomas Kleist
Thomas Kleist answered on Sep 5, 2019 7:11 PM

that works but what if I want to update the another cell if I edit the mmRabat column ?

0
Thomas Kleist
Thomas Kleist answered on Sep 5, 2019 6:29 PM

I have tried the function that you suggested and I'm still getting an RangeError: Maximum call stack size exceeded exception 

0
Thomas Kleist
Thomas Kleist answered on Sep 5, 2019 8:55 AM

Hi Maya

the error is happening when I it tries to update an cell value 

mmRabat.update(1); if I out comment the mmRabat.update(v) it does not crash  and the action event in the grid is 

(onCellEdit)="totalSum()"
the version I'm using is
"igniteui-angular": "^8.1.4",