oracle-apexoracle-apex-5.1oracle-apex-18.2

Interactive Grid - JavaScript getValue


I’m struggling to obtain the new value that is being set in an editable Interactive Grid. I’ve created a dynamic action to be fired when the column has changed. The dynamic action is firing as expected, but it’s returning the previous value and not the value that triggered the event.

The dynamic action is set to execute JavaScript:

var $te = $(this.triggeringElement);
var rowID = $te.closest('tr').data('id');
var grid = apex.region('IG_SCALE_1').call('getViews','grid');
var model = grid.model;
var record = model.getRecord(rowID);
var column_val = model.getValue(record,”COLUMN_1”);

apex.item(“P1_HIDDEN_1”).setValue(column_val);

Let’s say column_1 had a value of 0 and that value was changed to 1. The code is setting the hidden item’s value to 0. I need it to be set to 1.

When I execute the following code I can see the old value in the array.

console.log(record);

Is there anything that I can do to obtain the new value?

Many thanks.. let me know if you have any questions!


Solution

  • You might be encountering one of the bugs, which are fixed in APEX version 19.2.

    John Snyders described in his blog APEX IG Cookbook update for 19.2

    One of the bugs had to do with changes to the last edited cell not always being saved.

    A list of all fixed bugs in 19.2 is available here: APEX 19.2 Release Notes. Search for 26963177 and 29132960 in particular.

    Can you reproduce the issue in apex.oracle.com environment?