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: how to capture the javascript triggering row

seanzhDec 11 2024

Morning all,

Apex 24.1 , Interactive grid.

I have an action column like below. As Now I must use setTimeout to capture this triggering row, any better way? thanks

<span style="background-color:yellow; color:red;font-size: large;">&MSG.</span>
<button type="button"  tabindex="-1" onclick="commentEdit( '&MSG.' )" class="a-Button a-Button--noLabel a-Button--iconTextButton  " title="Comments">
<span class="fa fa-comment-o fa-lg"></span>
</button>
function commentIG ( answer){

   let gridView = apex.region("CART_IG_ID").call('getViews').grid;
   let  records = gridView.getSelectedRecords();
   let model = gridView.model;

if (records.length )
{  //console.log('answer='+answer);
   model.setValue(records[0], 'MSG', answer);
   app.quietSave("CART_IG_ID", itemsGridStatus)
   //spex.region("CART_IG_ID").refresh();
}
}

function commentEdit( existText){
 let answer;
 if( existText)
  answer=prompt("Line Remark", existText);
  else
  answer=prompt("Line Remark");
  // if answer is empty, we delete the message
  if (answer===null) return;//cancel
 setTimeout (commentIG, 500, answer);
       

}	
This post has been answered by Karel Ekema on Dec 12 2024
Jump to Answer
Comments
Post Details
Added on Dec 11 2024
4 comments
365 views