Hi, I am using JS in a Web Resource, and tying it to a Subgrid Control to be trigger upon onChange.
I am able to read the cell value which was triggered by the OnChange of the field.
Next, I would need to loop through the remaining rows in the subgrid and read each cell for every row.
May I know how can it be done?
Thank you.
Current code snippet:
function SetNA(context) {
debugger;
//id of the subgrid
var id = formContext.data.entity.getId();
// get the attribute which fired the onchange.
var changedFirstNameAttr = context.getEventSource();
// get the container for the attribute.
var attrParent = changedFirstNameAttr.getParent();
// var FirstName Field Attribute
var changedFirstNameField = attrParent.attributes.get("firstName");
// get the value of the changed first name value
var changedFirstNameValue = changedFirstNameAttr.getValue();
alert(changedFirstNameValue);
if (changedFirstNameValue != null)
{
//loop through other rows in the subgrid, and read each cell value
}
}