Skip to Main Content
Feature Request FR-2953
Product Area Documentation
Status CLOSED

9 Voters

Easy-to-Use Published Javascript Library to Expose underlying features of Interactive Grid

stew stryker Public
· Jan 30 2023

Idea Summary
I would like to be able to find, understand and access the primary Interactive Grid functionality through published Javascript functions.  This method would act as a front-end to the existing IG libraries that shows us features, but whose definitions be could changed by an upgrade.

Use Cases

  • Get/Set IG attributes
  • Create and Modify IG menu options (Actions and Row Menus), including defining custom buttons that reference our own JS function.
  • Get specified column value(s) for the selected row(s)
  • Get ID of currently-selected Saved report
  • Get IDs and Names of Saved reports
  • Get ID of Primary Saved report
  • Change currently-selected Saved report to a new value

Preferred Solution (Optional)
In my mind, this could be a new Javascript library that clarifies and simplifies access to key Interactive Grid features. It would be well-documented with examples that novice JS programmers (who understand the basic IG model and know what they want to do) could use with confidence.

We reviewed this idea carefully, and while it was interesting, we concluded that due to all the internal implications we need to take into account, it is unlikely to make its way into APEX.

Comments

Comments

  • ino.laurensse OP 2.3 years ago

    There are many IG ideas. This one (for easier JavaScript APIs) comes close to what is discussed in

    https://apex.oracle.com/ideas/FR-2348

  • stew stryker OP 2.3 years ago

    @ino.laurensse Yes, this idea for a library of wrappers around IG functions was discussed there. It was you that brought up the concept and said that your team has created wrappers around some commonly-used Javascript API functions for IGs. Your comment was the germ for this Idea suggestion.

    I'm trying to break that smaller idea out of that larger idea (i.e. “give us a simpler Interactive Grid”), in hopes it might get done.

  • stew stryker OP 2.2 years ago

    An extension of my original idea would be an APEX DA plug-in that calls the either a new wrapper JS library or the original APEX IG libraries to simplify these features.

    Or maybe more developers would find it useful if this proposed plug-in was provided instead of my original idea?

    (Procedural question: Do I need to propose a new idea to be voted on, instead of this comment?)

  • john.snyders APEX Team OP 2.1 years ago

    Thanks for the Use Cases. It is helpful. I agree that the API doc could be improved. Specific doc questions/suggestions can be shared on the APEX forum. 

    Much of IG APIs are already documented and supported. This means you can feel safe in using them because we will give a deprecation notice in the unlikely event we ever change the API.

    There are many parts/layers that make up IG. The model is almost completely documented. Similar for the grid widget and its base class tableModelViewBase. Unfortunately probably only about half of interactiveGrid widget is documented and toolbar widget not at all. Menus and actions are documented. 

    • Get/Set IG attributes

    Supported get: apex.region(staticId).call("option", optionname), 
    set: apex.region(staticId).call("option", optionname, value).
    The problem is that many IG options are not documented. Most are nested under the config option. It is also possible to drill into the views such as grid view to set options.

    • Create and Modify IG menu options (Actions and Row Menus), including defining custom buttons that reference our own JS function.

    This is partially documented and could be improved. The menu and action apis are documented. The toolbar is not. This could be made easier

    • Get specified column value(s) for the selected row(s)

    This is documented

    let m = apex.region(staticId).call("getCurrentView").model;
    let sel = apex.region(staticId).call("getSelectedRecords");
    m.getValue(sel[0], columnname);
    

    I guess you are asking for an easier API but it is not clear to me what it could be considering there are so many ways in which you might want to process the selected records. 

    • Get ID of currently-selected Saved report
    • Get IDs and Names of Saved reports
    • Get ID of Primary Saved report
    • Change currently-selected Saved report to a new value

    The above can be accomplished with actions API.

    apex.region(staticId).call("getActions").lookup("change-report").choices
    

    But a more direct API to query/manipulate reports would make a nice enhancement.

    It is true that there are areas of the API that we should document. Better examples are needed for some of the APIs. There are even improvements or additions to the API that would be helpful. However, I don't see us creating a “new Javascript library” that does what the existing one already does.

    Anyone is free to create reusable wrappers (DA actions or js library) and share them. 

    A simple grid region is a distinct idea; a good one.

  • stew stryker OP 2.1 years ago

    @john.snyders Thanks for your considered and thorough reply, as well as solving for my use-cases.

    I've searched the Forum, Slack channel, Git repositories and the general web. I've found the methods to achieve my use-cases, but there was a significant cost of time. I guess what I'm looking for is a single source of the truth, that doesn't require so much searching, trying to guess the right keywords, separating the wheat from the chaff of blogs and ChatGPT responses, etc.

    1. The existing API documentation assumes a level of JS knowledge and is about “what does this function do?”. 
    2. There are APEX IG sites that show how to solve some of these needs, but there isn't one that solves all of them, with the source code available. I wish such a thing existed. 
    3. I think another avenue would be a book/blog site that would get me to the point where I could understand how to use the JS API documentation to solve my needs. There used to be a number of books on APEX that guided us through how to get something done, like a really boring cookbook with recipes. But there aren't many current APEX books these days, and I haven't seen one that digs into the IG API (though it might exist?). 

    Sorry for rambling, just trying to think out loud.

    Thanks again for your consideration. And thanks to the APEX team for their great work.