Activate help link on home made widget

1893
3
12-14-2015 06:51 AM
MathieuVILLEMONT1
Occasional Contributor

Generic web appbuilder widgets setting page displays a link to access the help.

However home made widgets do not display such link.

My solution is the following hack :

_help: '<my own help url>',

startup: function () {

     ...

     dojoQuery(".help-link").forEach(lang.hitch(this, function (node, index) {

          domStyle.set(node, "display", "inline-block");

          domAttr.set(node, "href", this._help);

     }));

}

Any other suggestions welcome.

Ce message a été modifié par : Mathieu VILLEMONT My initial post did not include the hack :\

0 Kudos
3 Replies
RobertScheitlin__GISP
MVP Esteemed Contributor

Mathieu,

  I have discussed this with the development team last year at the Dev Summit. that custom widget developers need the ability to add help links to custom widgets. I informed them of the Hack I am having to use in all my widgets.

setConfig:function(config){

      //hack the 'Learn more about this widget link'

      setTimeout(function(){

        var helpLink = dojo.query('.help-link');

        helpLink[0].href = 'http://gis.calhouncounty.org/WAB/V1.2/widgets/eSearch/help/eSearch_Help.htm';

        html.setStyle(helpLink[0],'display','block');

      },600);

0 Kudos
MathieuVILLEMONT1
Occasional Contributor

Robert,

Indeed because the <a> is there anyway it would be nice to simply set it with a variable instead of hacking the DOM.

Nice help page btw. Did you use a template ? Markdown maybe ?

0 Kudos
RobertScheitlin__GISP
MVP Esteemed Contributor

Mathieu,

   No I just took what esri had for their widget help docs (at one point in the past) and tweaked it from my needs.

0 Kudos