Widget panel

492
2
Jump to solution
12-10-2018 02:58 AM
Labels (1)
JohnLocke1
New Contributor III

Hi everyone.

I have a little question, tried everything that I can, but is it possible to close the panel automatically, when start a widget? It's originally an off-panel widget, but I would like to group it... I want this, when open: 

Not this:

Thanks your help,

John

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

John,

   This widget is not designed at all to be used this way. But This is what you would need to change:

Add 'jimu/PanelManager', PanelManager to the define array and vars then add Line 14 below.

      onOpen: function() {
        this.setToggleLayer();
        var lObjs = [];
        array.map(this.toggleLayerIds, lang.hitch(this, function(id){
          var lyrNode = this.layerStructure.getNodeById(id);
          lObjs.push(lyrNode);
        }));
        if (!this.isToggling) {
          this.isToggling = true;
          this.toggleLayer(lObjs);
          setTimeout(lang.hitch(this, function() {
            this.isToggling = false;
            WidgetManager.getInstance().closeWidget(this);
            PanelManager.getInstance().minimizePanel(this.getPanel());
            if(lObjs[0].isToggledOn()){
              domClass.add(this.parentContainer, "jimu-state-selected");
            }else{
              domClass.remove(this.parentContainer, "jimu-state-selected");
            }
          }), 300);
        }
      },

View solution in original post

2 Replies
RobertScheitlin__GISP
MVP Emeritus

John,

   This widget is not designed at all to be used this way. But This is what you would need to change:

Add 'jimu/PanelManager', PanelManager to the define array and vars then add Line 14 below.

      onOpen: function() {
        this.setToggleLayer();
        var lObjs = [];
        array.map(this.toggleLayerIds, lang.hitch(this, function(id){
          var lyrNode = this.layerStructure.getNodeById(id);
          lObjs.push(lyrNode);
        }));
        if (!this.isToggling) {
          this.isToggling = true;
          this.toggleLayer(lObjs);
          setTimeout(lang.hitch(this, function() {
            this.isToggling = false;
            WidgetManager.getInstance().closeWidget(this);
            PanelManager.getInstance().minimizePanel(this.getPanel());
            if(lObjs[0].isToggledOn()){
              domClass.add(this.parentContainer, "jimu-state-selected");
            }else{
              domClass.remove(this.parentContainer, "jimu-state-selected");
            }
          }), 300);
        }
      },
JohnLocke1
New Contributor III

Thanks your quick help, it works well!!

0 Kudos