<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: the programmatically defined click event for template does not work in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/the-programmatically-defined-click-event-for/m-p/440456#M40621</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maria,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"&lt;SPAN style="background-color: #ffffff;"&gt;data-dojo-attach-event" is only for a templated dom element that is part of the widgets template, NOT something that dynamically add using domConstruct. In your case you just need to add a&lt;/SPAN&gt; "onclick".&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 11 Apr 2017 12:56:59 GMT</pubDate>
    <dc:creator>RobertScheitlin__GISP</dc:creator>
    <dc:date>2017-04-11T12:56:59Z</dc:date>
    <item>
      <title>the programmatically defined click event for template does not work</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/the-programmatically-defined-click-event-for/m-p/440454#M40619</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ,in a template based widget, I have a table in a template and the table’s body will be constructed&lt;/P&gt;&lt;P&gt;In my widget using domConstruct.&lt;/P&gt;&lt;P&gt;The problem is that The click event of “a” element does not work. Actually nothing happens when I click on it and the logging does not show any error or massage.( the other click events in My template work fine) the problem only is with this event that is made using domConstruct programmatically.please help me.&lt;/P&gt;&lt;P&gt;As I told everything work fine, the template widget work fine .the only problem is the below click event that does not work. &lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;for (var i = 0; i &amp;lt; result.features.length; i++) { &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; domConstruct.place(lang.replace('&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&amp;lt;a class="zoomto" data-dojo-attach-&amp;nbsp;&amp;nbsp; event="ondijitclick:zoomto"&amp;gt;{t0}&amp;lt;/a&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;{t1}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;{t2}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;{t3}&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;',{&lt;/P&gt;&lt;P&gt;&amp;nbsp; t0:i + 1,&lt;/P&gt;&lt;P&gt;&amp;nbsp; t1:result.features&lt;I&gt;.attributes.rent,&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; t2:result.features&lt;I&gt;.attributes.OBJECTID,&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; t3:result.features&lt;I&gt;.attributes.ACCT&lt;/I&gt;&lt;/P&gt;&lt;P&gt;}), this.rowNode);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;…..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;zoomto: function () { &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; console.log("zoomto is clicked ");&lt;/P&gt;&lt;P&gt;},&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Apr 2017 04:53:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/the-programmatically-defined-click-event-for/m-p/440454#M40619</guid>
      <dc:creator>Mariagomez1</dc:creator>
      <dc:date>2017-04-11T04:53:40Z</dc:date>
    </item>
    <item>
      <title>Re: the programmatically defined click event for template does not work</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/the-programmatically-defined-click-event-for/m-p/440455#M40620</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;it possible that i need to parse the new nodes in table's body? if it is right, i do not know how to do it ...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Apr 2017 05:10:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/the-programmatically-defined-click-event-for/m-p/440455#M40620</guid>
      <dc:creator>Mariagomez1</dc:creator>
      <dc:date>2017-04-11T05:10:27Z</dc:date>
    </item>
    <item>
      <title>Re: the programmatically defined click event for template does not work</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/the-programmatically-defined-click-event-for/m-p/440456#M40621</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maria,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"&lt;SPAN style="background-color: #ffffff;"&gt;data-dojo-attach-event" is only for a templated dom element that is part of the widgets template, NOT something that dynamically add using domConstruct. In your case you just need to add a&lt;/SPAN&gt; "onclick".&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Apr 2017 12:56:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/the-programmatically-defined-click-event-for/m-p/440456#M40621</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2017-04-11T12:56:59Z</dc:date>
    </item>
    <item>
      <title>Re: the programmatically defined click event for template does not work</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/the-programmatically-defined-click-event-for/m-p/440457#M40622</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Robert, Thank you, you always help me when i encounter with a error. you are right, i should not use "&lt;SPAN style="background-color: #ffffff;"&gt;data-dojo-attach-event"&lt;/SPAN&gt;. I actually decided to use domConstruct.create for each element in tbody separately and also i used lang.hitch for executing the event's function. i thought this explanations might help a person.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Apr 2017 05:38:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/the-programmatically-defined-click-event-for/m-p/440457#M40622</guid>
      <dc:creator>Mariagomez1</dc:creator>
      <dc:date>2017-04-14T05:38:03Z</dc:date>
    </item>
    <item>
      <title>Re: the programmatically defined click event for template does not work</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/the-programmatically-defined-click-event-for/m-p/440458#M40623</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That was a helpful post but when i am adding onclick in the domCreate, it is searching in the index.html and showing an error _customfunction() is not defined in the index page.&lt;/P&gt;&lt;P&gt;I can't use lang.hitch functions for the events cause i have to add the same element multiple times...&lt;/P&gt;&lt;P&gt;Please help me on this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;BR /&gt;Naveen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Nov 2017 03:26:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/the-programmatically-defined-click-event-for/m-p/440458#M40623</guid>
      <dc:creator>naveenbesri</dc:creator>
      <dc:date>2017-11-20T03:26:58Z</dc:date>
    </item>
    <item>
      <title>Re: the programmatically defined click event for template does not work</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/the-programmatically-defined-click-event-for/m-p/440459#M40624</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Got the solution.. I created the below code ...&lt;/P&gt;&lt;P&gt;on(query('id'), "click", lang.hitch(this, this.customFunction))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Nov 2017 05:02:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/the-programmatically-defined-click-event-for/m-p/440459#M40624</guid>
      <dc:creator>naveenbesri</dc:creator>
      <dc:date>2017-11-20T05:02:36Z</dc:date>
    </item>
  </channel>
</rss>

