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');
},
So what's not working? Does the image show up on the widget? Do you have widgets/ElevationProfile/images/help.png and a widgets/ElevationProfile/help/index.html in your app?
My bad. The 'Help' image is in the Elevation Widget. when hover over the 'Help' mage on the widget my pointer does not turn into a pointing finger and if i click on it the 'Help' nothing happens. I do have the widgets/ElevationProfile/images/help.png and widgets/ElevationProfile/help/index.html in the app.
I am still struggling on how to do this. Would really appreciate some help.
So are you getting any errors in your browsers web console?
I don't get any errors, it's as if when i click on the 'Help' button nothing happens at all, no click or anything.
And you have code in your widget that calls _bindEvents right?
That image does not show me that you are actually calling that function though.
oh well maybe that's my problem i thought i was. How call that function correctly?