A quick update this error appears when the code is trying to set the Total cell value. So it is obviously wrong.
I rewrote this function a bit and only missing bit is updating the cell value:
I retrieve the new value from PD cell and the existing value from BI cell ok.
I just need to now update the value of the 'Total' cell.
Please let me know.
If the below could be done in a more elegant way, please advise. This code looks way to complex for what it does.
Thanks.
function CalculateTotalAndValidateData(sender, args) {
var grid = $find('<%= myGrid.ClientID %>');
var masterTable = grid.get_masterTableView();
var rows = masterTable.get_dataItems();
var rowArgs = args.get_row();
var rowIndex = rowArgs.sectionRowIndex;
var row = rows[rowIndex];
var txtTotal = row.get_cell("Total");
var txtPd;
var txtBi;
var totalAmount;
if (args._columnUniqueName === "PD") {
txtPd = parseFloat(args._value.replace(/,/g,''));
txtBi = (isNaN(parseFloat(row.get_cell("BI").outerText.replace(/,/g,''))))
? 0
: parseFloat(row.get_cell("BI").outerText.replace(/,/g,''));
totalAmount = txtPd + txtBi;
alert(totalAmount);
//txtTotal.innerHTML = totalAmount;
}
...continue on to other cells.
}