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!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

How to disable sorting and set width to all columns in IG using the JavaScript Initialization Code

Akil RAug 13 2021 — edited Aug 13 2021
  1. For the sorting, I have used the below code in the Execute When Page Loads section of the page and it works fine
    apex.region("MY_IG_STATIC_ID").call("getViews").grid.view$.grid( "option", "columnSort", false );
    But how can the same be achieved using the JavaScript Initialization Code of the Interactive Grid
    I have tried using the below code but it does not work
    function( config) {
    var colOptions = config.columns;
    for (let i = 0; i < colOptions.length; i++) {
    let isHidden = colOptions[i].isHidden;
    if(!isHidden) {
    colOptions[i].canSort = false;
    }
    }
    return config;
    }
  2. For the Column Width I have used the below code in the Execute When Page Loads section of the page and it works fine. But it slows down the loading of IG because my IG has more number of columns.
    var igView = apex.region("MY_IG_STATIC_ID").call("getViews").grid.view$, colArray = [];
    colArray = igView.grid("getColumns");
    for (i=0; i<colArray.length-1; i++){
    igView.grid("setColumnWidth",colArray[i].property,300);
    }
    How can the same be achieved using the JavaScript Initialization Code of the Interactive Grid.

@john-snyders-oracle can you please guide on how this can be achieved

This post has been answered by John Snyders-Oracle on Sep 9 2021
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 4 2025
Added on Aug 13 2021
4 comments
1,803 views