In Oracle Apex, in master-detail form, my detail is interactive Grid
I want calculation on runtime like when I give some value in the amount column in the first row then add a row and again I input some value in the amount column both rows some show in page item in master on runtime
Vinish Kapoor
Specify a static id to your grid, for example, igitems.
Now create a dynamic action on the amount column of IG for change event. Create a true action as Set Value. Set the type as PL/SQL expression. Specify the PL/SQL expression as :AMOUNT. Submit item AMOUNT. Set affected items Px_AMOUNT. Then create another true action to execute JavaScript code and add the following code in it:
Suppose you have an item Px_AMOUNT on your page. The above program will calculate the sum of the amount column and will set the value of the Px_AMOUNT item.
Fahad
Hi Vinish,
This script is not working with lov column, it throws NAN exception.
Could you possibly advise how to get the values from lov column and then take sum like you did above.
Rishabh Chowdhury
Hi Vinish,
I tried implementing the in an interactive grid. Since i am new to oracle APEX, specially in the JS side, so i am stuck with a problem.
while checking in the console, i found "n_amt = parseInt(igrow[col_amt], 10);" is returning NaN.
The drop down i used in the field of IG for which i am calculation the sum is a select list with LOV as a pipelined function returning table of number.
If you can kindly give me the solution. Thanks in advance.
Fahad
Did you get any solution on this? Please share it.
HashimHussain
use this parseInt(igrow[col_amt].v, 10) insted of parseInt(igrow[col_amt], 10);
Mohamed
If the interactive grid has many rows. this function only works with first 50 or 100.
I tried to loop using foreach and apply action in DB but i found that it only works with the first 50 or 100 rows. is there any workaround for this issue?