AnsweredAssumed Answered

wiring a button click event in an InfoWindow

Question asked by canadajebus on Jun 5, 2015
Latest reply on Jun 5, 2015 by KEkenes-esristaff

Hi, I have InfoWindow popups when users clicks a layer on my map.  I am doing a lot of custom formating in these info windows and require having a html button in them.  I can get the button to appear no trouble, but I can't get it's click event to work or call a function in my code.

 

I've tried multiple approaches including using:

<button id='myButton' onclick='myFunction();'>Label</button>

when I create the button in the InfoTemplate.setContent method.  Doing this tells my that my function is undefined.

 

Also tried wiring the event in multiple location such as by using:

on(dom.byId("myButton", "click", function() {

     console.log("test");

});

But nothing happens.

 

 

Thanks for the help!

Outcomes