AnsweredAssumed Answered

Add help button link inside widgets

Question asked by CCweedcontrol on May 4, 2017
Latest reply on May 10, 2017 by CCweedcontrol

Not sure how complicated it is but i would like to add a 'Help' button onto some of the widgets i have on my application. I tried coping the 'Measure' widget code but i can't get to work. I would gratefully appreciate any help please.

 

I have added the help image to html with the following and can see the help icon inside the widget.

div data-dojo-type="jimu/dijit/LoadingShelter" data-dojo-attach-point="shelter" data-dojo-props="hidden:true"></div>
  <br><br><br><br><br><br><br><br><br><br><br><br>
    <img src="widgets/ElevationProfile/images/help.png" height="25" width="62" data-dojo-attach-point="helpImage" style="cursor:pointer" />
</div>

 

I added the function in the _blindEvents: Function like so.

_bindEvents: function () {
        this.own(on(this.btnClear, 'click', lang.hitch(this, this._clear)));
        html.setStyle(this.btnClear, 'display', 'none');
        this.own(on(this.btnExport, 'click', lang.hitch(this, this._export)));
        this.own(on(this.helpImage, 'click', lang.hitch(this, function() {
            var win = window.open("widgets/ElevationProfile/help/index.html", "_blank");
  win.focus();
        })));
        html.setStyle(this.btnExport, 'display', 'none');
        html.setStyle(this.btnInfo, 'display', 'none');
        html.setStyle(this.btnDownload, 'display', 'none');
      },

Outcomes