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!

How to get previous and next row data in an Interactive grid

josjosSep 30 2022

Hello,
I'm using apex 21.2
I get the ID from first and last record like this:

var grid = apex.region('MY_INTERACTVE_GRID').call('getCurrentView'),
    model = grid.model,
    totalRecords = model.getTotalRecords(),
    firstRecord = model.recordAt(1),
    lastRecord = model.recordAt(totalRecords  - 1);

console.log(firstRecord[1]);
console.log(lastRecord[1]);

I also can get the selected id record ...

var model = this.data.model;
if (this.data != null){
  if(this.data.selectedRecords[0] != null){
    v_curr_id = model.getValue(this.data.selectedRecords[0], "ID");
  }
}
apex.item("P1_SELECTED_ID").setValue(v_curr_id);

but how do I get the ID from the previous and next row ?

This post has been answered by Hamza Al-abbasi on Oct 1 2022
Jump to Answer
Comments
Post Details
Added on Sep 30 2022
4 comments
2,928 views