Press "Enter" to skip to content

APEX Interactive Grid API Improvements in 5.1.1

Last updated on Friday, March 31, 2017

Normally there isn’t too much excitement around a patch set release but if you are programming Interactive Grid (IG) then APEX 5.1.1 is a big deal. A number of improvements were made to IG and its component parts that make it easier to configure and control from JavaScript and in some cases make possible things that weren’t possible before. Even if you are using IG without client side custom code you will be interested in 5.1.1 for the 31 bugs that have been fixed. IG will continue to get better and 5.1.1 is a good next step.

As soon as Interactive Grid came out in APEX 5.1 people started customizing it in all kinds of interesting ways. We knew from experience with interactive reports that people would want to customize and control IG using JavaScript. We included APIs and options that we thought would be useful but in many cases these were not heavily exercised. During the 5.1 early adopter releases we were mainly interested in feedback on the declarative features and use of IG, which we got plenty of. We never invited people to try out the APIs. It just didn’t make sense for us or our customers from a priority standpoint. So the 5.1 release was the first time the APIs were put to real world tests. Many great questions were asked on the APEX forums. We learned a lot about what people want to do with IG.

Many of the questions that came up on the forums were things we anticipated. In these cases the response was a simple “Just do this“. In some cases bugs were found that prevented the APIs or configuration options from working as intended. Where practical these bugs were fixed. Sometimes when I saw what the solution looked like I realized that there should be an easier or more robust way. And finally some questions pointed us to things we hadn’t thought of or fully thought out. Where possible these things were added in 5.1.1 and otherwise recorded for future consideration.

In working through these use cases we decided that some of the IG widget methods were stable enough to use so we added doc comments to the widget.interactiveGrid.js file for them. There are still a number of them that are marked as internal use only that you should avoid. As a reminder all these IG related APIs and options are not documented or supported. They may change from one release to the next.

A big reason for delaying the fourth part of my How to Hack Interactive Grid series is so that it could be based on 5.1.1. I will also go back and update the first three parts to reflect the 5.1.1 improvements.

Here is a brief summary of the improvements. You will need to read the source doc comments for details.

Toolbar Related:

  • A getToolbar method was added to the IG widget and recordView widget.
  • A findGroup method was added to the toolbar widget and ids were added to IG toolbar control groups.
  • A toolbar control such as a button can override the icon in the action with null to remove the icon.
  • The IG default toolbar added id properties to sub-menu entries and a toolbarFind method was added to the default toolbar array returned by copyDefaultToolbar.

Model Related:

  • There is a minor change in behavior for getTotalRecords and a new getServerTotalRecords method was added.
  • New notifications addData and instanceRename were added.
  • A fetchAll method was added

IG Widget Related:

  • The grid view now has properties for row actions and selection actions menus (rowActionMenu$ and selActionMenu$).
  • Added getSelectedRecords and setSelectedRecords methods.
  • Added getCurrentView method.
  • The viewchange event now has a created Boolean property.
  • New events reportsettingschange and save were added.
  • The IG apex.region interface is created before events are fired.

IG Configuration Related:

  • Allows setting column options with defaultGridColumnOptions object.
  • The grid view options columnSort, reorderColumns, and resizeColumns are now controlled by config.views.grid.features sort, reorderColumns, and resizeColumns.
  • Extra model options can be set with config.defaultModelOptions.
  • A stretchColumns option was added to config.views.grid.features. It is used to set the value for noStretch column config if not already specified.
  • The config.views.grid.features highlight, controlBreak, aggregate are now hooked up.

2 Comments

  1. ozren pestic
    ozren pestic Saturday, May 27, 2017

    Hi John,
    I have one ( maybe few) question.

    I would like to use IG with some public saved report in a form of table, but also as a chart. These are JET charts but I can’t change any attributes of the chart. Is it possible to do that? For example the colour of circle in bubble chart, or width of the bar. How to add some additional functionality to the chart?

    Thanks!

  2. Yosra
    Yosra Monday, May 15, 2017

    Hi John,
    Thanks for this article. It’s very helpfull.
    I have used your examples on the use of getSelectedRecords, but I need to use setSelectedRecords also to control the selected rows of the interactive grid based on a page item value.
    I have searched the net for examples but I can’t find any. Could you please give an example of how to use this ?

    Thanks a lot.
    Yosra

Comments are closed.