I have an interactive grid region in oracle apex that I want to be able to maximize via a toggle button located on the far right side of the toolbar. The customization of the toggle button itself has been relatively straightforward but I am struggling with how to implement the maximize function. I included the code I have so far that is located in the interactive grid’s "Initialization JavaScript Function" section.
function(config) {
let $ = apex.jQuery,
toolbarData = $.apex.interactiveGrid.copyDefaultToolbar(),
toolbarGroup = toolbarData.toolbarFind("actions4");
toolbarGroup.controls.push(
{
type: "TOGGLE",
action: "maximize-region",
icon: "fa fa-expand"
}
);
config.initActions = function(actions){
actions.add({
name: "maximize-region",
maximize: false,
set: function(maximize) {
this.maximize = maximize;
//jQuery to maximize the region would go here
}, get: function() {
return this.maximize;
}
});
}
config.toolbarData = toolbarData;
return config;
}
Any help would be greatly appreciated!
2
Answers
Why wouldn’t you use built-in maximize button?
You can try a few tricks, like this one:
Page – Function and Global Variable Declaration:
and checking ‘Show Maximize Button’ in the ‘Interactive Report’ template.
But I think at the end of the day, maximizing an IG is simply not supported.
Maximizing is a UT feature. Problem is, the IG is client-side generated, which happens after UT has initialized the page. Subsequently, the IG is also not providing a placeholder for the UT to generate the Maximize button.
You can try by changing the template from ‘Interactive Report’ to ‘Standard’ and skipping above code. But most likely, you will see the IG not responding well to the resize events. And that is the second problem: upon resize, the IG should also reorganize itself as to accommodate the revised number of rows. I found it buggy there.