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!

Javascript and function in Interactive Grid for a dynamic action on a column

Srini-SMay 18 2020 — edited May 20 2020

I am trying to use javascript and a function to call a dynamic action. I would like to invoke this dynamic action whenever any of the three columns are updated in the interactive grid, the fourth column becomes the concatenated value of the values input in the three columns.

Please help me with syntax to be used to refer the column values by column name or id or lable and corrections. This is what I have done so far.

Page Level - Function and Global Variable Declaration

--------------------------------------------------------------------------------

function update_description() {
   $('input[id="C4"]').each ( function concatenateDescription() {
   var rowId = this.id;
   var noun = $('#C1'+rowId).val();
   var desc = $('#C2'+rowId).val();
   var dim_spec = $('#C3'+rowId).val();
   var final_desc = string.concat(noun, ',',desc, ',',dim_spec);
   $('#C4'+rowId).val(final_desc);
});
}

Here C1, C2 and C3 are the static ids of the driving columns and C4 is the resultant column.

On page load, I run

update_description();

On each of the C1, C2 and C3 : custom attribute: onchange="concatenateDescription();"

The error that I get is that the function is being wrongly called (invalid reference  .....)

Edited:

Actual error that I see in the console when I change a value in any of the columns is :

Uncaught ReferenceError: concatenateDescription is not defined   at HTMLInputElement.onchange

Comments
Post Details
Added on May 18 2020
15 comments
5,127 views