Hello,
The issue you are facing here, i.e. the javascript of a subform does not work properly on the master form, is because of the javascript code used there.
The javascript code includes the event handler on the form, i.e.:
Code: Select all$("form").setOnchange(function(field, newVal, oldVal) {.....});
which is not in a working state right now in ProcessMaker for the subforms.
This results in a problem that the grids cannot interact with the text fields through javascript when placed in a subform.
This has already been reported as a
bug and will be resolved soon.
Here is a workaround for your requirement(fetch the sum calculated for the column 'Estimate Cost Shs' in a text field).
Take a
button, on click of which the total is fetched from the
sum function, which calculates the sum.
The only javascript code that needs to be placed in the subform is:
Code: Select allfunction sum() {
var total = document.getElementById('sum-gridSalaryProvide-provideEstimateCost').value;
$("#provideEstimateSum").setValue(total);
}
document.getElementById("getsum").onclick = sum;
where
getsum is the id of the button and 'sum-gridSalaryProvide-provideEstimateCost' is the id of the input field that stores the sum value.
You need not add any javascript to the master form. The javascript from the subform automatically concatenates with it.
You can refer the subform attached here:
(5.08 KiB) Downloaded 393 times
Hope this helps
Best Regards
Mishika