AnsweredAssumed Answered

programatically hide widget or widgets-group in Launchpad theme widgets-panel

Question asked by levmichael on Oct 1, 2020

I use WEB AppBuilder (Developer Edition) 2.17, Launchpad theme, on 3D scenes.

I created in widgets-panel a widget-group with 3 widgets inside it, each of them is activated from another widget,

so I need that this widgets-group of 3 widgets will NOT be seen, and also will not occupy space within widgets-panel.

 

I inserted next code at end of WidgetManager.js loadWidget function setTimeout (between lines 127 and 128) -

if (setting.uri.includes("AnchorBarController") && !that.isDbgGroup) {
    let parent = document.querySelector(".iconList .iconGroup");
    if (parent) {
        if (parent.lastChild) {
            if (parent.lastChild.id === "uniqName_3_13")
                parent.removeChild(parent.lastElementChild);
        }
    }
}

But there are 3 drawbacks in how I implemented the hiding:

  1. This works well in app,
    and also in WAB itself when I open the app by clicking "Launch", but NOT when I open the app by clicking "Configure app" and when I'm in the app I change Scene (since then these classes within dom have different names).
  2. Depending on class name given by Theme could cause mistakes.
  3. The widgets-group is hidden but still occupies place within widgets-panel.

 

So, I need a more robust way to hide that widgets-group programatically.

I also wish, if possible, that this widgets-group will not occupy place within the widgets-panel (but I still need of course that these widgets in the hidden widgets-group could be activated from another widget).

Outcomes