Forum Stats

  • 3,827,534 Users
  • 2,260,790 Discussions
  • 7,897,295 Comments

Discussions

Hide Interactive Grid Column on Region Refresh

SteveQuinlivan
SteveQuinlivan Member Posts: 68 Red Ribbon
edited May 23, 2022 12:41PM in APEX Discussions

Afternoon all,

I'm aware I can hide an Interactive Grid column on page submit / render using Server Side Conditions, but I'm wondering if it can be done via a refresh Dynamic action without having to re submit / render the whole page.

I have a Select List that when changed, triggers a refresh of an IG region and changes the displayed data.

I have a new requirement to hide certain columns in the IG when there is a particular value in the select list, and ideally to be able to do this smoothly / dynamically.

I'm using Apex 19.2.

As always any help greatly appreciated.

Regards

Tagged:

Best Answer

  • SteveQuinlivan
    SteveQuinlivan Member Posts: 68 Red Ribbon
    Answer ✓

    Just to confirm that i have figured out how to do this using a DA - Execute JavaScript Code by using the below code

    var ig$ = apex.region("IG_STATIC_ID").widget(),   

    view = ig$.interactiveGrid("getCurrentView");

    var gridView = apex.region("IG_STATIC_ID").call("getViews").grid;

    /// Show Hide COLUMN

    if ($v("FIELD_ON_FORM") === "VALUE_TO_CHECK_FOR") {  gridView.view$.grid("hideColumn", "COLUMN_NAME");

                      }

    else{  gridView.view$.grid("showColumn", "COLUMN_NAME");

      }

    The column name is the column name as appears on the right hand side of the design window under Identification

    Regards

Answers

  • SteveQuinlivan
    SteveQuinlivan Member Posts: 68 Red Ribbon
    Answer ✓

    Just to confirm that i have figured out how to do this using a DA - Execute JavaScript Code by using the below code

    var ig$ = apex.region("IG_STATIC_ID").widget(),   

    view = ig$.interactiveGrid("getCurrentView");

    var gridView = apex.region("IG_STATIC_ID").call("getViews").grid;

    /// Show Hide COLUMN

    if ($v("FIELD_ON_FORM") === "VALUE_TO_CHECK_FOR") {  gridView.view$.grid("hideColumn", "COLUMN_NAME");

                      }

    else{  gridView.view$.grid("showColumn", "COLUMN_NAME");

      }

    The column name is the column name as appears on the right hand side of the design window under Identification

    Regards