Select to view content in your preferred language

Hide widget icon

3054
4
Jump to solution
12-19-2016 11:36 AM
GregRieck
Frequent Contributor

Jewelry Box theme. WAB 2.2

Hello,

My custom widgets are launched through a feature action. However, I still seem to have to have the widget icons visible on the map window. Is it possible to hide the widget icons? I tried changing the location of them in the config.json by pushing them off the left side. But that also made the widget launch off the viewable area. I'd like to hide the widget icons and still have the widget launch inside the map windows viewable area.

Thank You,

Greg

Tags (1)
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

Greg,

   No you do not have to anything else beside changing the 

if(this.widgetConfig.label === 'Enhanced Search'){

"Enhanced Search" to the actual label of the widget you are wanting to hide.

All of this is assuming you are talking about hiding on screen widgets.

View solution in original post

4 Replies
RobertScheitlin__GISP
MVP Emeritus

Greg,

   In your apps jimu.js/OnScreenWidgetIcon.js file find the postCreate method and add code like this (lines 6-8):

    postCreate: function(){
      this.inherited(arguments);
      this.iconNode = html.create('img', {
        src: this.widgetConfig.icon
      }, this.domNode);
      if(this.widgetConfig.label === 'Enhanced Search'){
        html.setStyle(this.domNode, 'display', 'none');
      }
GregRieck
Frequent Contributor

Robert,

Nope, that didn't do anything. Am I suppose to do anything else? Move the widgets off screen? And yes I'm sure I got the correct file. I'm in Icon not Panel, OnScreenWidgetIcon.js.

Greg

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Greg,

   No you do not have to anything else beside changing the 

if(this.widgetConfig.label === 'Enhanced Search'){

"Enhanced Search" to the actual label of the widget you are wanting to hide.

All of this is assuming you are talking about hiding on screen widgets.

GregRieck
Frequent Contributor

Robert,

Yes, that worked. I misunderstood the need to replace Enhanced Search with my widget name, I apologize. Had I put a break point and looked closer I think I would have understood that.

Thank you,

Greg

0 Kudos