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!

IG model JavaScript loop stops at 50 records. How to loop through all the records?

ilmarskNov 16 2021

Hello,
Apex 20.2.0.00.20; Listener 19.4.6.r1421859; Oracle 18c XE
Dabbling in IG model with JavaScript. Trying to get various counts based on the values. Stuck on model not looping past 50 records. Simplified code to show the issue is below. Loop count always stops at 50, while getTotalRecords functions returns in this case 51 records (DEMO_STATES table).
On even bigger tables I have had getTotalRecords = -1 and loop stops at 50.
How does one loop through all the records in IG table with javascript?
I am aware of PL/SQL solution, but would prefer JavaScript due to slight flickering/visible delayed update on the screen.
Thank you!

var model = apex.region("test_ig").widget().interactiveGrid("getViews", "grid").model;
var loop_cnt=0;
var get_total_cnt=0;
model.forEach(function(igrow) {
       ++loop_cnt;
       console.log(loop_cnt); 
});
 console.log("Loop count:"+loop_cnt);
 get_total_cnt = model.getTotalRecords();
 console.log("Get total count:"+get_total_cnt);
This post has been answered by ilmarsk on Nov 16 2021
Jump to Answer
Comments
Post Details
Added on Nov 16 2021
3 comments
1,757 views