AnsweredAssumed Answered

Close Dialog Popup on Hyperlink Click

Question asked by LeviCecil on Aug 10, 2017
Latest reply on Jan 4, 2018 by rscheitlin

I have a dialog popup with a hyperlink. I want the popup to close when the link is clicked. I've tried "nboLink.on("click", closeDialog);" but the console says that this is not a function. Here is my code: 

 

Layer.on("click", function(evt){
            var name = evt.graphic.attributes.NAME;
            var nameNoDot = name.replace(/\./g,"");
            var nameDash = nameNoDot.replace(/_/g, "-");
            var nameLower = nameDash.toLowerCase();
          
           
          var nboLink = "<b>${NAME}</b><hr><a target='_blank' href='http://website/profiles/" + nameLower +
              "'><b>Profile</b></a>";
                  
          var popupContent = esriLang.substitute(evt.graphic.attributes,nboLink);
           
          dialog.setContent(popupContent);

          domStyle.set(dialog.domNode, "opacity", 0.70);
           
          dijitPopup.open({
            popup: dialog,
            x: evt.pageX,
            y: evt.pageY,
          });
    
          function closeDialog(){
               map.graphics.clear();
               dijitPopup.close(dialog);
               };
              
         
        });

Outcomes