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);
}