Share ideas, ask questions, and get feedback about developing for ProcessMaker
Forum rules: Please post new questions under "Developing processes & programming" for ProcessMaker 2 or 3.
#780341
grid total_as suggested.PNG
as suggested in the 2nd website
grid total_as suggested.PNG (19.99 KiB) Viewed 10063 times
Dear all,

I need to design a form with a grid and simple textbox which is used to store the sum total of the grid.

(Please note in the same dynaform, i know how to make the global variable and create the textbox in the next dynaform and make it shows the sum total of the grid field)

I have tried solutions like
<1>http://forum.processmaker.com/viewtopic ... tal#p23151
<2>http://forum.processmaker.com/viewtopic ... tal#p20685

i would like choose the 2nd approach, see pic below:
( i have changed the last line grid_myGrid.onaddrow to "myGrid.onaddrow", cause the original it always prompt me error message that this "grid_myGrid" doesn't exist.)

I have tried, problems faced: the first row whatever i keyed, the textbox will received, but the 2nd or 3rd or onwards, the textbox field stays there without any changes.
Please give me some hints or point me where i'm wrong, thanks in advance!

Really urgent! Much appreciated
Attachments
grid total1.PNG
the 1st row is okay
grid total1.PNG (6.92 KiB) Viewed 10063 times
grid total.PNG
the 2nd and onwards rows are not okay
grid total.PNG (6.18 KiB) Viewed 10063 times
#827224
Can you give full and finish example of script?
Code: Select all

function sumGrid() {
    var noRows = Number_Rows_Grid("MyGrid", "amount");
    total = 0;
    for (var i = 1; i <=noRows; i++) {
        total += parseFloat(getGridField("MyGrid, i, "ammount).value);
    }
    getField("Total").value = total;
}
//When form loads, loop through all existing rows, settings the event handler for "approved":
var totRows = Number_Rows_Grid("MyGrid", "amount");
for (var iRow = 1; iRow <= totRows; iRow++) {
    getGridField("MyGrid", iRow, "amount").onchange = sumGrid;
}
//set the event handler when user adds a row:
grid_MyGrid.onaddrow = function(iRow) {
    getGridField("MyGrid", iRow, "amount").onchange = sumGrid;
}

This one don`t work

A 1xbet clone script is a pre-designed software so[…]

4rabet clone script is enabling entrepreneurs to e[…]

Parimatch clone script is enabling entrepreneurs t[…]

In the world of cryptocurrency, a wallet is an app[…]