Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interactive Grid Model data NOT synced with change, Bug?

seanzhJul 2 2020 — edited Jul 8 2020

Hi, All, Apex20.1 here

it seems I can't get the sum of one IG column right , here is the setup ( I got a very simple IG on apex.oracle.com and was able to reproduce IG model data problem).

in column "Quantity", a DA with change event fires up this JS code:

apex.item("CPRICE").setValue( apex.item("CQTY").getValue()* 4 );

in Column 'Unit Price", a DA with change runs this code:

var model = apex.region("IG_ITEMS").widget().interactiveGrid("getViews", "grid").model;

var n_sal, n_totsal = 0;

col_salary = model.getFieldKey("UNIT_PRICE");

model.forEach(function(igrow) {

n\_sal = parseInt(igrow\[col\_salary\], 10);

if (!isNaN(n\_sal)) {

    n\_totsal += n\_sal;

}

});

$s("P1_TOT", n_totsal);

It seems the model still rememberers its previous data after its value is set by Quantity Change DA( Quantity * 4), the screen data looks right but not model data, I really got lost and don't know why , more importantly how can I get an interactive sum of an IG column for something like dollar total? please enlighten me.

Screen Shot 2020-07-02 at 8.05.53 PM.png

This post has been answered by InoL on Jul 2 2020
Jump to Answer
Comments
Post Details
Added on Jul 2 2020
8 comments
1,696 views