Hi Everybody. I have a grid and want to update/manipulate some of its elements

Hi Everybody. I have a grid and want to update/manipulate some of its elements as changes are made by the user to other elements. We use the Advanced Forms Utilities plugin and JS code on grid elements "change" Event Rules for that purpose. For example this code for adding the "num1" and "num2" columns and placing it in "num3" :

var index = window.FormDesigner.lastRowEvent;
var aRows = window.FormAPI.getValue("num1").id.split(';');
var bRows = window.FormAPI.getValue("num2").id.split(';');
var a = aRows[index];
var b = bRows[index];
var c = parseFloat(a)+parseFloat(b);
if ( !isNaN(c) )
{
document.getElementsByName("num3")[index].value=c;
}

This works so long as the user is just adding rows or modifying elements, but when a row is deleted then the "lastRowEvent" references are incorrect and the wrong elements are used as the user makes changes.

How can I reference the row index and elements correctly in all circustamces as the...

OriginalPostID-42448

OriginalPostID-42448

  Discussion posts and replies are publicly visible

Parents Reply Children
No Data