AnsweredAssumed Answered

Add functionality to <button> tag embedded in an InfoWindow

Question asked by jonczerniak on Sep 24, 2015
Latest reply on Sep 30, 2015 by jonczerniak

Hola everybody,

 

I've successfully added an html button within an InfoWindow.  However, I am having trouble calling functionality when the button is clicked.  I've tried onClick within the html tag, using the 'on' event listener, and querying for the button class and listening for the 'click' event.  If someone could point me in the right direction that would be great.  Thanks for your time.

 

Cz

 

var sources = search.sources;

            sources.push({

               featureLayer: layer,

               placeholder: "L0400409",

               enableLabel: false,

               searchFields: ["NUMBER_KEY"],

               displayField: "NUMBER_KEY",

               exactMatch: false,

               outFields: ["*"],

 

 

               //Create an InfoTemplate

               infoTemplate: new InfoTemplate("Casefile Info", "<a href= ${CASE_NUM} target=_blank ;'>Additional Info</a></br></br>NumberKey: ${NUMBER_KEY}</br>TLNO: ${TLNO}</br><button type='button' id='infoBtn' class='infoBtn';'>Click Me</button>")

            });

 

          //Add functionality to the infoBtn here

Outcomes