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 JS API to get total number of records and current record position: undefined?

seanzhJun 26 2020 — edited Jun 26 2020

Hi, everyone,

I am not too happy to post too many questions here  as if I ask you to help me with my job.

My last post    is kind of bug report. Here I am complaining IG Javascript API doc is really hard to read and follow. As a JS newbie, I found  IG is  very powerful  but still a good amount of customizations must be done to make it as good as multi-line data entry Oracle Forms , which works great with very little work.

Today's questions are simple, how do I get total number of rows to an IG and also the index for current record ( use as line# )?  I searched for a while and found this one line code

var model = apex.region("INV_ITEMS_IG_ID").widget().interactiveGrid("getViews", "grid").model;

One blog says to use  model.length to  get total number of rows, it returns "undefined". I checked its keys, which includes 2 promising properties, totalRecods  and index, but both return as undefined

//alert ("total records=" + model.totalRecords);

//alert ("index=" +model.index);

I knew I did something wrong but can't find a way to get it right, can you please enlighten me ?   Thank you

This post has been answered by Keyser on Jun 26 2020
Jump to Answer
Comments
Post Details
Added on Jun 26 2020
3 comments
5,451 views