Forum Stats

  • 3,768,172 Users
  • 2,252,755 Discussions
  • 7,874,481 Comments

Discussions

Removing items from row action menu in Interactive grid in Apex 20.1

Jake4321
Jake4321 Member Posts: 213 Blue Ribbon
edited Sep 24, 2020 9:51AM in APEX Discussions

Hi all,

just referring back to this previous post Removing items from row action menu in Interactive grid in Apex 5.1

I am trying to remove the add button from my interactive grid and I beleive I am getting in the snag on the last paragraph where John Snyder mentions this :

"it doesn't work because the hidden state comes from the action if there is one. So what you can do to keep the actions but hide the menu items is this:"$(function() {    // listen for view change events to find out when grid views are created    $("#equipetravail").on("interactivegridviewchange", function(event, data) {        if ( data.view === "grid" && data.created ) {            var view = apex.region("equipetravail").widget().interactiveGrid("getViews", "grid"),                menu$ = view.selActionMenu$;var item;menu$ = view.rowActionMenu$;item = menu$.menu("find", "ins");item.action = function() {};item.hide = true;        }    });});

Now I am trying to figure out exactly what this means and where exactly I should put this code.

Currently I have  allmost everything working except I have this in my grid:

pastedImage_3.png

So I suspect I have to either hide and remove or remove and hide. This is my code to remove.

function(config) {config.reportSettingsArea = false;config.defaultGridViewOptions = {footer: false};config.initActions = function( actions ) {    actions.remove("selection-add-row");    actions.remove("row-add-row");      }return config;

Question  is where and when do I hide the button?

Any comments, tips suggestions are greatly appreciated as usual.

Thanks,

Jake

Modified by : Jake4321

JeanYves Bernier

Best Answer

  • Jake4321
    Jake4321 Member Posts: 213 Blue Ribbon
    edited Sep 24, 2020 9:42AM Accepted Answer

    Ends up that if you want to hide the interactive grid button without disabling the add action the best way to do  this  is to add the following code to the inline page css

    #equipetravail button[data-action="selection-add-row"] {    display: none !important;}

    So this does it for me.

    Thanks all,

    Jacques

    JeanYves Bernier

Answers

  • Jake4321
    Jake4321 Member Posts: 213 Blue Ribbon
    edited Sep 24, 2020 9:42AM Accepted Answer

    Ends up that if you want to hide the interactive grid button without disabling the add action the best way to do  this  is to add the following code to the inline page css

    #equipetravail button[data-action="selection-add-row"] {    display: none !important;}

    So this does it for me.

    Thanks all,

    Jacques

    JeanYves Bernier